File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 2121import requests as req
2222from aw_core .dirs import get_data_dir
2323from aw_core .models import Event
24+ from aw_transform .heartbeats import heartbeat_merge
2425
2526from .config import load_config
2627from .singleinstance import SingleInstance
3132
3233
3334def _log_request_exception (e : req .RequestException ):
34- r = e .response
3535 logger .warning (str (e ))
3636 try :
37- d = r . json ()
37+ d = e . response . json () if e . response else None
3838 logger .warning (f"Error message received: { d } " )
3939 except json .JSONDecodeError :
4040 pass
@@ -152,7 +152,7 @@ def get_event(
152152 event = self ._get (endpoint ).json ()
153153 return Event (** event )
154154 except req .exceptions .HTTPError as e :
155- if e .response .status_code == 404 :
155+ if e .response and e . response .status_code == 404 :
156156 return None
157157 else :
158158 raise
@@ -230,8 +230,6 @@ def heartbeat(
230230 the function will in that case always returns None.
231231 """
232232
233- from aw_transform .heartbeats import heartbeat_merge
234-
235233 endpoint = f"buckets/{ bucket_id } /heartbeat?pulsetime={ pulsetime } "
236234 _commit_interval = commit_interval or self .commit_interval
237235
You can’t perform that action at this time.
0 commit comments