mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-09-07 10:41:57 +00:00
Move Measure block inside loop
This commit is contained in:
parent
973d67a033
commit
b9e888858c
@ -113,20 +113,20 @@ class _ServiceQueuer(object):
|
|||||||
if service.id in self.requests_in_flight:
|
if service.id in self.requests_in_flight:
|
||||||
return
|
return
|
||||||
|
|
||||||
with Measure(self.clock, "_ServiceQueuer._send_request"):
|
self.requests_in_flight.add(service.id)
|
||||||
self.requests_in_flight.add(service.id)
|
try:
|
||||||
try:
|
while True:
|
||||||
while True:
|
events = self.queued_events.pop(service.id, [])
|
||||||
events = self.queued_events.pop(service.id, [])
|
if not events:
|
||||||
if not events:
|
return
|
||||||
return
|
|
||||||
|
|
||||||
|
with Measure(self.clock, "_ServiceQueuer._send_request"):
|
||||||
try:
|
try:
|
||||||
yield self.txn_ctrl.send(service, events)
|
yield self.txn_ctrl.send(service, events)
|
||||||
except:
|
except:
|
||||||
logger.exception("AS request failed")
|
logger.exception("AS request failed")
|
||||||
finally:
|
finally:
|
||||||
self.requests_in_flight.discard(service.id)
|
self.requests_in_flight.discard(service.id)
|
||||||
|
|
||||||
|
|
||||||
class _TransactionController(object):
|
class _TransactionController(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user