diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-08 12:45:47 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-08 12:45:47 +0200 |
commit | a9d650dcde43c0facf7341fa0fc8b215412cd298 (patch) | |
tree | d3cfade929437b8556ab6da0319e53e9dc3832f6 /module | |
parent | Fixpack (5) (diff) | |
download | pyload-a9d650dcde43c0facf7341fa0fc8b215412cd298.tar.xz |
Fix https://github.com/pyload/pyload/issues/1975
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/Account.py | 8 | ||||
-rw-r--r-- | module/plugins/internal/Addon.py | 13 |
2 files changed, 8 insertions, 13 deletions
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py index 20ecf6afd..8ef8ee305 100644 --- a/module/plugins/internal/Account.py +++ b/module/plugins/internal/Account.py @@ -13,7 +13,7 @@ from module.utils import compare_time, lock class Account(Plugin): __name__ = "Account" __type__ = "account" - __version__ = "0.57" + __version__ = "0.58" __status__ = "testing" __description__ = """Base account plugin""" @@ -64,11 +64,11 @@ class Account(Plugin): return True - def start_periodical(self, interval=None, threaded=False, delay=0): + def start_periodical(self, interval=None, threaded=False, delay=None): if interval is not None and self.set_interval(interval) is False: return False else: - self.cb = self.pyload.scheduler.addJob(max(0, delay), self._periodical, [threaded], threaded=threaded) + self.cb = self.pyload.scheduler.addJob(max(1, delay), self._periodical, [threaded], threaded=threaded) return True @@ -91,7 +91,7 @@ class Account(Plugin): except Exception, e: self.log_error(_("Error executing periodical task: %s") % e, trace=True) - self.restart_periodical(self.interval, threaded) + self.restart_periodical(threaded=threaded, delay=self.interval) def periodical(self): diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py index 32344191a..47c5584f5 100644 --- a/module/plugins/internal/Addon.py +++ b/module/plugins/internal/Addon.py @@ -23,7 +23,7 @@ def threaded(fn): class Addon(Plugin): __name__ = "Addon" __type__ = "hook" #@TODO: Change to `addon` in 0.4.10 - __version__ = "0.10" + __version__ = "0.11" __status__ = "testing" __threaded__ = [] #@TODO: Remove in 0.4.10 @@ -98,11 +98,11 @@ class Addon(Plugin): return True - def start_periodical(self, interval=None, threaded=False, delay=0): + def start_periodical(self, interval=None, threaded=False, delay=None): if interval is not None and self.set_interval(interval) is False: return False else: - self.cb = self.pyload.scheduler.addJob(max(0, delay), self._periodical, [threaded], threaded=threaded) + self.cb = self.pyload.scheduler.addJob(max(1, delay), self._periodical, [threaded], threaded=threaded) return True @@ -118,11 +118,6 @@ class Addon(Plugin): self.cb = None - #: Deprecated method, use `start_periodical` instead (Remove in 0.4.10) - def initPeriodical(self, *args, **kwargs): - return self.start_periodical(*args, **kwargs) - - def _periodical(self, threaded): try: self.periodical() @@ -130,7 +125,7 @@ class Addon(Plugin): except Exception, e: self.log_error(_("Error executing periodical task: %s") % e, trace=True) - self.restart_periodical(self.interval, threaded) + self.restart_periodical(threaded=threaded, delay=self.interval) def periodical(self): |