diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-06 14:01:27 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-06 14:01:27 +0100 |
commit | b811c9857491c0569ae367708721fbbaebf3adab (patch) | |
tree | 146db37c9e180c67ebc8d5d120ac5e22a029120d /synapse/storage/_base.py | |
parent | Re-implement DEBUG_CACHES flag (diff) | |
download | synapse-b811c9857491c0569ae367708721fbbaebf3adab.tar.xz |
Remove failed deferreds from cache
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/_base.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index 8384299a13..99c0948754 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -205,8 +205,14 @@ class CacheDescriptor(object): self.function_to_call, obj, *args, **kwargs ) - ret = ObservableDeferred(ret, consumeErrors=False) + def onErr(f): + cache.invalidate(*keyargs) + return f + + ret.addErrback(onErr) + + ret = ObservableDeferred(ret, consumeErrors=False) cache.update(sequence, *(keyargs + [ret])) return ret.observe() |