Skip to content

Commit

Permalink
[#124] logging the exception message for trigger and scheduler jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Jun 7, 2024
1 parent 1975a58 commit b94eeed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions triggers/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ async def do_daily():
else:
# couldn't retrieve matching repository record
await db["discovery"].delete_one({"_id": submission.identifier})
except:
logger.exception(f"Failed to collect submission {submission.url}")
except Exception as err:
logger.exception(f"Failed to collect submission {submission.url}\n Error: {str(err)}")


def main():
Expand Down
4 changes: 2 additions & 2 deletions triggers/update_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ async def _main():
while True:
try:
await watch_catalog(db)
except:
logger.exception("Submission Watch Task failed, restarting the task")
except Exception as exp:
logger.exception(f"Submission Watch Task failed.\n Error:{str(exp)}\n Restarting the task")
finally:
db.close()

Expand Down
4 changes: 2 additions & 2 deletions triggers/update_typeahead.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ async def _main():
while True:
try:
await watch_discovery(db)
except:
logger.exception("Discovery Watch Task failed, restarting the task")
except Exception as exp:
logger.exception(f"Discovery Watch Task failed.\n Error:{str(exp)}\n Restarting the task")
finally:
db.close()

Expand Down

0 comments on commit b94eeed

Please sign in to comment.