mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-02-02 19:49:15 +01:00
Better error handling with cache.put
This commit is contained in:
parent
1b32423881
commit
d3b28c42e6
@ -113,7 +113,9 @@ class TaskCache():
|
|||||||
self._base[key] = (
|
self._base[key] = (
|
||||||
self._get_ttl_time(ttl), value
|
self._get_ttl_time(ttl), value
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
print(str(e))
|
||||||
|
print(traceback.format_exc())
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
@ -283,6 +285,7 @@ def render(req : ImageRequest):
|
|||||||
r.stream_image_progress = False
|
r.stream_image_progress = False
|
||||||
|
|
||||||
new_task = RenderTask(r)
|
new_task = RenderTask(r)
|
||||||
task_cache.put(r.session_id, new_task, TASK_TTL)
|
if task_cache.put(r.session_id, new_task, TASK_TTL):
|
||||||
tasks_queue.put(new_task)
|
tasks_queue.put(new_task)
|
||||||
return new_task
|
return new_task
|
||||||
|
raise RuntimeError('Failed to add task to cache.')
|
||||||
|
Loading…
Reference in New Issue
Block a user