Add create_requester function

Wrap the `Requester` constructor with a function which provides sensible
defaults, and use it throughout
This commit is contained in:
Richard van der Hoff 2016-07-26 16:46:53 +01:00
parent 33d7776473
commit eb359eced4
11 changed files with 106 additions and 80 deletions

View file

@ -20,7 +20,6 @@ from synapse.storage.prepare_database import prepare_database
from synapse.storage.engines import create_engine
from synapse.server import HomeServer
from synapse.federation.transport import server
from synapse.types import Requester
from synapse.util.ratelimitutils import FederationRateLimiter
from synapse.util.logcontext import LoggingContext
@ -512,7 +511,3 @@ class DeferredMockCallable(object):
"call(%s)" % _format_call(c[0], c[1]) for c in calls
])
)
def requester_for_user(user):
return Requester(user, None, False)