Skip to content

Commit 767aa74

Browse files
committed
Make _EPSILON a Duration
1 parent e4f2285 commit 767aa74

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

synapse/http/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ def _is_ip_blocked(
161161
return True
162162
return False
163163

164-
165-
_EPSILON = 0.00000001
164+
# The delay used by the scheduler to schedule tasks "as soon as possible", while
165+
# still allowing other tasks to run between runs.
166+
_EPSILON = Duration(microseconds=1)
166167

167168

168169
def _make_scheduler(clock: Clock) -> Callable[[Callable[[], object]], IDelayedCall]:
@@ -173,7 +174,7 @@ def _make_scheduler(clock: Clock) -> Callable[[Callable[[], object]], IDelayedCa
173174

174175
def _scheduler(x: Callable[[], object]) -> IDelayedCall:
175176
return clock.call_later(
176-
Duration(seconds=_EPSILON),
177+
_EPSILON,
177178
x,
178179
)
179180

0 commit comments

Comments
 (0)