Skip to content

Commit

Permalink
Ensure a bad task serialization does not ruin whole batch of scheduled.
Browse files Browse the repository at this point in the history
Fixes #815
  • Loading branch information
coleifer committed Sep 24, 2024
1 parent 946563b commit be6b06b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions huey/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,15 @@ def add_schedule(self, task):
def read_schedule(self, timestamp=None):
if timestamp is None:
timestamp = self._get_timestamp()
return [self.deserialize_task(task)
for task in self.storage.read_schedule(timestamp)]
accum = []
for msg in self.storage.read_schedule(timestamp):
try:
task = self.deserialize_task(msg)
except Exception:
logger.exception('Unable to deserialize scheduled task.')
else:
accum.append(task)
return accum

def read_periodic(self, timestamp):
if timestamp is None:
Expand Down

0 comments on commit be6b06b

Please sign in to comment.