Skip to content

Commit

Permalink
Exclude on_opened and on_closed from watcher events
Browse files Browse the repository at this point in the history
We're not interested in these. `on_opened` in particular was introduced
in gorakhargosh/watchdog#941 and then partially
reverted in
gorakhargosh/watchdog@25a2d1f,
but that doesn't work for us.

Should fix galaxyproject#16840
  • Loading branch information
mvdbeek committed Oct 13, 2023
1 parent 4a397b1 commit e9bc593
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/galaxy/util/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,17 @@ class EventHandler(FileSystemEventHandler):
def __init__(self, watcher):
self.watcher = watcher

def on_any_event(self, event):
# this effectively excludes on_opened and on_closed
def on_moved(self, event):
self._handle(event)

def on_created(self, event):
self._handle(event)

def on_deleted(self, event):
self._handle(event)

def on_modified(self, event):
self._handle(event)

def _extension_check(self, key, path):
Expand Down

0 comments on commit e9bc593

Please sign in to comment.