We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5c359bf + 9af4683 commit a2877d3Copy full SHA for a2877d3
django_lightweight_queue/cron_scheduler.py
@@ -50,8 +50,15 @@ def run(self) -> None:
50
)
51
52
while True:
53
- # This will run until the process terminates.
54
- self.tick(backend)
+ try:
+ # This will run until the process terminates.
55
+ self.tick(backend)
56
+ except Exception:
57
+ # Log that something went wrong, but ensure that this thread
58
+ # carries on running. Otherwise a single network error talking
59
+ # to a backend can result in the cron scheduler dying until a
60
+ # human notices that things aren't running.
61
+ self.logger.exception("Error during tick")
62
63
# Sleep until the next second boundary. This corrects for skew
64
# caused by the accumulation of tick() runtime.
0 commit comments