fix edu batching hackery
parent
eb0334b07c
commit
000d230901
|
@ -389,15 +389,18 @@ class TransactionQueue(object):
|
||||||
else:
|
else:
|
||||||
self.pending_edus_by_dest.setdefault(destination, []).append(edu)
|
self.pending_edus_by_dest.setdefault(destination, []).append(edu)
|
||||||
|
|
||||||
|
if destination not in self.edu_tx_time_by_dest:
|
||||||
|
txtime = self.clock.time() + EDU_BATCH_TIME * 1000
|
||||||
|
self.edu_tx_time_by_dest[destination] = txtime
|
||||||
|
|
||||||
if destination in self.edu_tx_task_by_dest:
|
if destination in self.edu_tx_task_by_dest:
|
||||||
# we already have a job queued to send EDUs to this destination
|
# we already have a job queued to send EDUs to this destination
|
||||||
return
|
return
|
||||||
|
|
||||||
def send_edus():
|
def send_edus():
|
||||||
del self.edu_tx_task_by_dest[destination]
|
del self.edu_tx_task_by_dest[destination]
|
||||||
self._send_new_transaction(destination)
|
self._attempt_new_transaction(destination)
|
||||||
|
|
||||||
self.edu_tx_time_by_dest = self.clock.time() + EDU_BATCH_TIME * 1000
|
|
||||||
self.edu_tx_task_by_dest[destination] = self.clock.call_later(
|
self.edu_tx_task_by_dest[destination] = self.clock.call_later(
|
||||||
EDU_BATCH_TIME, send_edus,
|
EDU_BATCH_TIME, send_edus,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue