Skip to content

Commit

Permalink
feat: add error handling for cache retrieval in CachedTaskWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
provos committed Feb 6, 2025
1 parent 1e2956b commit de58729
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/planai/cached_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def _pre_consume_work(self, task: Task):
self.pre_consume_work(task)

cache_key = self._get_cache_key(task)
result = self._cache.get(cache_key)
try:
result = self._cache.get(cache_key)
except Exception as e:
logging.error("Error getting cache key %s: %s", cache_key, str(e))
result = None

if result is not None:
cached_results, _ = result
Expand Down

0 comments on commit de58729

Please sign in to comment.