Skip to content

Commit

Permalink
fix: removed return of Event from heartbeat endpoint (API no longer r…
Browse files Browse the repository at this point in the history
…eturns an event)
  • Loading branch information
ErikBjare committed Sep 17, 2021
1 parent 0c0f4a0 commit 15bb696
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions aw_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
logging.getLogger("requests").setLevel(logging.WARNING)
logger = logging.getLogger(__name__)


def _log_request_exception(e: req.RequestException):
r = e.response
logger.warning(str(e))
Expand Down Expand Up @@ -197,7 +198,7 @@ def heartbeat(
pulsetime: float,
queued: bool = False,
commit_interval: Optional[float] = None,
) -> Optional[Event]:
) -> None:
"""
Args:
bucket_id: The bucket_id of the bucket to send the heartbeat to
Expand Down Expand Up @@ -240,16 +241,14 @@ def heartbeat(
data = last_heartbeat.to_json_dict()
self.request_queue.add_request(endpoint, data)
self.last_heartbeat[bucket_id] = event

return None
else:
return Event(**self._post(endpoint, event.to_json_dict()).json())
self._post(endpoint, event.to_json_dict()

#
# Bucket get/post requests
#

def get_buckets(self):
def get_buckets(self) -> dict:
return self._get("buckets/").json()

def create_bucket(self, bucket_id: str, event_type: str, queued=False):
Expand Down

0 comments on commit 15bb696

Please sign in to comment.