Skip to content

Commit

Permalink
Update event_debouncer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG authored Jul 28, 2024
1 parent b6d791f commit c7df2bf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/watchdog/utils/event_debouncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ def time_to_flush(self, started: float) -> bool:
def run(self):
with self._cond:
while self.should_keep_running():
started = time.monotonic()
if self.debounce_interval_seconds:
started = time.monotonic()
while self.should_keep_running():
timed_out = not self._cond.wait(
timeout=self.debounce_interval_seconds
)
timed_out = not self._cond.wait(timeout=self.debounce_interval_seconds)
if timed_out or self.time_to_flush(started):
break
else:
Expand All @@ -58,6 +56,6 @@ def run(self):
self._events = []
self.events_callback(events)

# send any events before leaving
# Send any events before leaving
if self._events:
self.events_callback(events)

0 comments on commit c7df2bf

Please sign in to comment.