TrackerList: make the plugin compatible with TrackerShare
This commit is contained in:
parent
d35a15d674
commit
37627822de
1 changed files with 13 additions and 11 deletions
|
@ -56,9 +56,6 @@ class TrackerList(object):
|
||||||
self.last_rescan_failed = False
|
self.last_rescan_failed = False
|
||||||
|
|
||||||
def reload(self):
|
def reload(self):
|
||||||
if "AnnounceShare" not in PluginManager.plugin_manager.plugin_names:
|
|
||||||
return
|
|
||||||
|
|
||||||
rescan_interval = config.tracker_list_rescan_interval
|
rescan_interval = config.tracker_list_rescan_interval
|
||||||
if self.last_rescan_failed:
|
if self.last_rescan_failed:
|
||||||
rescan_interval = (rescan_interval / 2, 60)
|
rescan_interval = (rescan_interval / 2, 60)
|
||||||
|
@ -68,14 +65,19 @@ class TrackerList(object):
|
||||||
|
|
||||||
self.last_rescan_time = time.time()
|
self.last_rescan_time = time.time()
|
||||||
|
|
||||||
try:
|
if "tracker_storage" not in locals():
|
||||||
if "tracker_storage" not in locals():
|
try:
|
||||||
from AnnounceShare.AnnounceSharePlugin import tracker_storage
|
if "TrackerShare" in PluginManager.plugin_manager.plugin_names:
|
||||||
self.tracker_storage = tracker_storage
|
from TrackerShare.TrackerSharePlugin import tracker_storage
|
||||||
if self.tracker_storage:
|
self.tracker_storage = tracker_storage
|
||||||
gevent.spawn(self.do_rescan)
|
elif "AnnounceShare" in PluginManager.plugin_manager.plugin_names:
|
||||||
except Exception as err:
|
from AnnounceShare.AnnounceSharePlugin import tracker_storage
|
||||||
self.log.error("%s" % Debug.formatException(err))
|
self.tracker_storage = tracker_storage
|
||||||
|
except Exception as err:
|
||||||
|
self.log.error("%s" % Debug.formatException(err))
|
||||||
|
|
||||||
|
if self.tracker_storage:
|
||||||
|
gevent.spawn(self.do_rescan)
|
||||||
|
|
||||||
|
|
||||||
if "tracker_list" not in locals():
|
if "tracker_list" not in locals():
|
||||||
|
|
Loading…
Reference in a new issue