Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nurdok committed Sep 10, 2024
1 parent 3b08f28 commit 3c122d6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/spanreed/plugins/spanreed_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,21 @@ async def _monitor_obsidian_plugin(self, user: User) -> None:
timeout -= time_since_last_watchdog

with suppress(asyncio.TimeoutError):
self._logger.info(f"Waiting for event on {queue_name} with timeout {timeout}")
async with asyncio.timeout(timeout.total_seconds()):
_, event_json = await redis_api.blpop(
queue_name,
)
event = json.loads(event_json)
self._logger.info(f"Obsidian plugin event received: {event}")
self._logger.info(
f"Obsidian plugin event received: {event}"
)
if event["kind"] == "error":
self._logger.info(f"Obsidian plugin error: {event}")
if event["message"] in self.OBSIDIAN_PLUGIN_ERROR_IGNORE_LIST:
if (
event["message"]
in self.OBSIDIAN_PLUGIN_ERROR_IGNORE_LIST
):
continue
time_since_last_obsidian_error_message = (
datetime.datetime.now()
Expand Down

0 comments on commit 3c122d6

Please sign in to comment.