diff options
author | Erik Johnston <erik@matrix.org> | 2015-06-01 14:03:29 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-06-01 14:03:29 +0100 |
commit | 06d1ec5dbcc2ea77636871d801be306d997baabb (patch) | |
tree | 88691348c1d60cb566d0da12c9fec0d5fe85d25b | |
parent | Time get_room_members (diff) | |
download | synapse-06d1ec5dbcc2ea77636871d801be306d997baabb.tar.xz |
Err, don't use global
-rwxr-xr-x | synapse/app/homeserver.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 4a92cdc368..008fd683bc 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -521,21 +521,20 @@ class SynapseSite(Site): def run(hs): def prof(f): - from synapse.handlers.room import total_time + import synapse.handlers.room import time def g(*args, **kwargs): - global total_time - total_time = 0 start = int(time.time()*1000) f(*args, **kwargs) end = int(time.time()*1000) - if end - start > 50: + if synapse.handlers.room.total_time > 50: logger.info( "Total time in get_room_members: %d ms / %d ms", int(total_time*1000), end - start ) + synapse.handlers.room.total_time = 0 return g reactor.runUntilCurrent = prof(reactor.runUntilCurrent) |