diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/database_backup.py | |
| parent | Also use docstrings to check if a command has help available, allow one-string (diff) | |
| signature | ||
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/database_backup.py')
| -rw-r--r-- | modules/database_backup.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/database_backup.py b/modules/database_backup.py index 27a366a3..45bc730f 100644 --- a/modules/database_backup.py +++ b/modules/database_backup.py @@ -1,4 +1,5 @@ import datetime, glob, os, shutil, time +from src import Utils BACKUP_INTERVAL = 60*60 # 1 hour BACKUP_COUNT = 5 @@ -10,10 +11,10 @@ class Module(object): until_next_hour = 60-now.second until_next_hour += ((60-(now.minute+1))*60) - events.on("timer.database-backup").hook(self.backup) bot.add_timer("database-backup", BACKUP_INTERVAL, persist=False, next_due=time.time()+until_next_hour) + @Utils.hook("timer.database-backup") def backup(self, event): full_location = self.bot.database.full_location files = glob.glob("%s.*" % full_location) |
