diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-18 18:36:21 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-18 18:36:21 +0200 |
commit | 70c56eb0bc606c35ffd6d137bf6d58c417a5cc49 (patch) | |
tree | 4ed0945a5af1b8705d2df784a64dba274a004491 /module | |
parent | [Account] Fix info syncing and corrupted password issue (diff) | |
download | pyload-70c56eb0bc606c35ffd6d137bf6d58c417a5cc49.tar.xz |
[Addon] Start periodical on plugin activation
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/Addon.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py index e41325a80..e5d9a2699 100644 --- a/module/plugins/internal/Addon.py +++ b/module/plugins/internal/Addon.py @@ -53,7 +53,7 @@ class Addon(Plugin): #: Callback of periodical job task, used by HookManager self.cb = None - self.interval = self.PERIODICAL_INTERVAL + self.interval = None self.init() self.init_events() @@ -126,14 +126,6 @@ class Addon(Plugin): raise NotImplementedError - def save_info(self): - self.store("info", self.info) - - - def restore_info(self): - self.retrieve("info", self.info) - - @property def activated(self): """ @@ -156,7 +148,7 @@ class Addon(Plugin): #: Deprecated method, use `deactivate` instead (Remove in 0.4.10) def unload(self, *args, **kwargs): - self.save_info() + self.store("info", self.info) return self.deactivate(*args, **kwargs) @@ -169,7 +161,11 @@ class Addon(Plugin): #: Deprecated method, use `activate` instead (Remove in 0.4.10) def coreReady(self, *args, **kwargs): - self.restore_info() + self.retrieve("info", self.info) + + if self.PERIODICAL_INTERVAL: + self.start_periodical(self.PERIODICAL_INTERVAL, delay=5) + return self.activate(*args, **kwargs) |