dropin

alternative frontend for dropout.tv
git clone https://git.ce9e.org/dropin.git

commit
ec956695de5fdd9f9aa97afd3820ee99517eaeba
parent
d0cd60d1de232d2452005fc1fc3748b7138c3465
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2025-02-06 22:12
set exception in async_cache

Diffstat

M dropin.py 7 ++++++-

1 files changed, 6 insertions, 1 deletions


diff --git a/dropin.py b/dropin.py

@@ -110,7 +110,12 @@ def async_cache(maxsize=128):
  110   110                 if len(cache) >= maxsize:
  111   111                     del cache[next(iter(cache))]
  112   112                 cache[key] = future
  113    -1                 future.set_result(await func(*args, **kwargs))
   -1   113                 try:
   -1   114                     future.set_result(await func(*args, **kwargs))
   -1   115                 except Exception as e:
   -1   116                     future.set_exception(e)
   -1   117                     del cache[key]
   -1   118                     raise
  114   119             return await cache[key]
  115   120         return wrapper
  116   121     return decorator