mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 07:58:38 +00:00
Fix enabling the Freespace plugin by initalizing self._timer on enable()
Stop the timer on disable()
This commit is contained in:
parent
6e737518d8
commit
02b71451c6
1 changed files with 3 additions and 5 deletions
|
@ -73,10 +73,7 @@ class Core(CorePluginBase):
|
||||||
DEFAULT_PREFS)
|
DEFAULT_PREFS)
|
||||||
self.notifications_sent = {}
|
self.notifications_sent = {}
|
||||||
|
|
||||||
if not self._timer:
|
self._timer = task.LoopingCall(self.update)
|
||||||
self._timer = task.LoopingCall(self.update)
|
|
||||||
else:
|
|
||||||
self._timer.stop()
|
|
||||||
self._interval = 60 * 5 # every 5 minutes
|
self._interval = 60 * 5 # every 5 minutes
|
||||||
if self.config['enabled']:
|
if self.config['enabled']:
|
||||||
self._timer.start(self._interval, False)
|
self._timer.start(self._interval, False)
|
||||||
|
@ -111,6 +108,8 @@ class Core(CorePluginBase):
|
||||||
"PluginDisabledEvent", self.__on_plugin_disabled
|
"PluginDisabledEvent", self.__on_plugin_disabled
|
||||||
)
|
)
|
||||||
self._cleanup.stop()
|
self._cleanup.stop()
|
||||||
|
if self._timer.running:
|
||||||
|
self._timer.stop()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
log.debug('Updating %s FreeSpace', self.__class__.__name__)
|
log.debug('Updating %s FreeSpace', self.__class__.__name__)
|
||||||
|
@ -200,4 +199,3 @@ class Core(CorePluginBase):
|
||||||
log.debug("Removing old(%s) path from notified paths: %s",
|
log.debug("Removing old(%s) path from notified paths: %s",
|
||||||
when, path)
|
when, path)
|
||||||
self.notifications_sent.pop(path)
|
self.notifications_sent.pop(path)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue