def _register_as_publisher(self): self.nb_api.create( core.Publisher( id=self.uuid, uri=self._get_uri(), last_activity_timestamp=time.time(), ), )
def _update_timestamp_in_db(self): if self._rate_limit(): return try: self.nb_api.update( core.Publisher( id=self.uuid, last_activity_timestamp=time.time(), ), ) except exceptions.DBKeyNotFound: self._register_as_publisher()