Skip to content

Commit

Permalink
refactor(watcher): skip is_interesting check if event already set
Browse files Browse the repository at this point in the history
  • Loading branch information
dairiki committed Mar 10, 2023
1 parent 6c909b8 commit 6855ec9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lektor/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ def __init__(self, is_interesting):
self.event = threading.Event()

def _check(self, path):
if self.is_interesting(None, None, path):
self.event.set()
if not self.event.is_set():
if self.is_interesting(None, None, path):
self.event.set()

# Generally we only care about changes (modification, creation, deletion) to files
# within the monitored tree. Changes in directories do not directly affect Lektor
Expand Down

0 comments on commit 6855ec9

Please sign in to comment.