We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d06e0c2 commit a36fe38Copy full SHA for a36fe38
epo_ops/middlewares/throttle/storages/sqlite.py
@@ -120,9 +120,13 @@ def delay_for(self, service):
120
)
121
else:
122
next_run = _now + timedelta(seconds=60.0 / r[limit])
123
- td = next_run - _now
124
- ts = td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6
125
- return ts / 10 ** 6
+
+ if next_run < _now:
+ return 0.0
126
+ else:
127
+ td = next_run - _now
128
+ ts = td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6
129
+ return ts / 10 ** 6
130
131
def update(self, headers):
132
"This method is a public interface for a throttle storage class"
0 commit comments