mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 07:23:52 +01:00
Be polite and ensure we use @functools.wraps() when creating a function decorator
This commit is contained in:
parent
6d33f97703
commit
1489521ee5
1 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,7 @@ import synapse.metrics
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from collections import namedtuple, OrderedDict
|
from collections import namedtuple, OrderedDict
|
||||||
|
import functools
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
@ -81,6 +82,7 @@ def cached(max_entries=1000):
|
||||||
|
|
||||||
cache[key] = value
|
cache[key] = value
|
||||||
|
|
||||||
|
@functools.wraps(orig)
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def wrapped(self, key):
|
def wrapped(self, key):
|
||||||
if key in cache:
|
if key in cache:
|
||||||
|
|
Loading…
Reference in a new issue