mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 20:54:50 -04:00
Time out typing over federation
This commit is contained in:
parent
667fcd54e8
commit
22578545a0
6 changed files with 119 additions and 82 deletions
|
@ -220,6 +220,7 @@ class MockClock(object):
|
|||
# list of lists of [absolute_time, callback, expired] in no particular
|
||||
# order
|
||||
self.timers = []
|
||||
self.loopers = []
|
||||
|
||||
def time(self):
|
||||
return self.now
|
||||
|
@ -240,7 +241,7 @@ class MockClock(object):
|
|||
return t
|
||||
|
||||
def looping_call(self, function, interval):
|
||||
pass
|
||||
self.loopers.append([function, interval / 1000., self.now])
|
||||
|
||||
def cancel_call_later(self, timer, ignore_errs=False):
|
||||
if timer[2]:
|
||||
|
@ -269,6 +270,12 @@ class MockClock(object):
|
|||
else:
|
||||
self.timers.append(t)
|
||||
|
||||
for looped in self.loopers:
|
||||
func, interval, last = looped
|
||||
if last + interval < self.now:
|
||||
func()
|
||||
looped[2] = self.now
|
||||
|
||||
def advance_time_msec(self, ms):
|
||||
self.advance_time(ms / 1000.)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue