Skip to content

Commit

Permalink
Improve logging for cron
Browse files Browse the repository at this point in the history
  • Loading branch information
ross-spencer committed Jul 4, 2024
1 parent 82bb577 commit 0898885
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/collector_node/collector_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def main():
"""Primary entry point of this script."""
pid = os.getpid()
start_time = time.time()
logger.info("----- node runner (%s) -----", pid)
try:
with flock.FlockContext():
try:
Expand All @@ -309,11 +310,11 @@ def main():
except Exception as err:
logger.error("collector node runner not running: %s", err)
except BlockingIOError as err:
logger("collector node runner already in use: %s", err)
logger.info("collector node runner already in use: %s", err)
sys.exit(1)
end_time = time.time() - start_time
logger.info(
"collector node runner (%s) completed after: '%s' seconds", pid, end_time
"----- node runner (%s) completed after: '%s' seconds -----", pid, end_time
)


Expand Down
2 changes: 1 addition & 1 deletion src/collector_node/flock.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Flock management.
"""Flock (file lock) management.
via. https://seds.nl/notes/locking-python-scripts-with-flock/
"""
Expand Down

0 comments on commit 0898885

Please sign in to comment.