Skip to content

Commit

Permalink
Only monitor for config modification events
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon committed May 8, 2024
1 parent 24cc883 commit 59fb0c3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cloudbot/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ def on_moved(self, event):


class ConfigEventHandler(ReloadHandler):
def on_any_event(self, event):
self.bot.logger.info("Config event: %s", event)
self.loader.reload(getattr(event, "dest_path", event.src_path))
def on_created(self, event):
self.loader.reload(event.src_path)

def on_deleted(self, event):
self.loader.reload(event.src_path)

def on_modified(self, event):
self.loader.reload(event.src_path)

def on_moved(self, event):
self.loader.reload(event.dest_path)

0 comments on commit 59fb0c3

Please sign in to comment.