Skip to content

Commit 53c5cc0

Browse files
committed
FB: never sleep less than zero seconds
1 parent 96c0b45 commit 53c5cc0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

reflex/istate/manager/disk.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,12 @@ async def _process_write_queue_delay(self):
209209
if self._write_queue:
210210
# There are still items in the queue, schedule another run.
211211
now = time.time()
212-
next_write_in = min(
213-
self._write_debounce_seconds - (now - item.timestamp)
214-
for item in self._write_queue.values()
212+
next_write_in = max(
213+
0,
214+
min(
215+
self._write_debounce_seconds - (now - item.timestamp)
216+
for item in self._write_queue.values()
217+
),
215218
)
216219
await asyncio.sleep(next_write_in)
217220
elif self._write_debounce_seconds > 0:

0 commit comments

Comments
 (0)