Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
c13820bc
Commit
c13820bc
authored
4 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
fix failure case
parent
2b3af017
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/util/caches/deferred_cache.py
+4
-1
4 additions, 1 deletion
synapse/util/caches/deferred_cache.py
with
4 additions
and
1 deletion
synapse/util/caches/deferred_cache.py
+
4
−
1
View file @
c13820bc
...
...
@@ -31,6 +31,7 @@ from typing import (
from
prometheus_client
import
Gauge
from
twisted.internet
import
defer
from
twisted.python
import
failure
from
synapse.util.async_helpers
import
ObservableDeferred
from
synapse.util.caches.lrucache
import
LruCache
...
...
@@ -223,7 +224,9 @@ class DeferredCache(Generic[KT, VT]):
# we can save a whole load of effort if the deferred is ready.
if
value
.
called
:
self
.
cache
.
set
(
key
,
value
.
result
,
callbacks
)
result
=
value
.
result
if
not
isinstance
(
result
,
failure
.
Failure
):
self
.
cache
.
set
(
key
,
result
,
callbacks
)
return
value
# otherwise, we'll add an entry to the _pending_deferred_cache for now,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment