mirror of
https://git.deluge-torrent.org/deluge
synced 2025-09-07 02:25:35 +00:00
Fix blocklist ignoring try_times.
Make blocklist print error messages on failures.
This commit is contained in:
parent
d5a11d0e95
commit
4cde35a067
2 changed files with 9 additions and 9 deletions
|
@ -24,6 +24,8 @@
|
||||||
page in certain locales
|
page in certain locales
|
||||||
* Fix blocklist not recognising comments that begin with whitespace
|
* Fix blocklist not recognising comments that begin with whitespace
|
||||||
* Minor speedup in parsing blocklists
|
* Minor speedup in parsing blocklists
|
||||||
|
* Blocklist now attempts to download the URL multiple times before giving
|
||||||
|
up
|
||||||
|
|
||||||
=== Deluge 1.2.0_rc5 (17 December 2009) ===
|
=== Deluge 1.2.0_rc5 (17 December 2009) ===
|
||||||
==== Web ====
|
==== Web ====
|
||||||
|
|
|
@ -246,7 +246,6 @@ class Core(CorePluginBase):
|
||||||
if "Moved Permanently" in error_msg:
|
if "Moved Permanently" in error_msg:
|
||||||
log.debug("Setting blocklist url to %s", location)
|
log.debug("Setting blocklist url to %s", location)
|
||||||
self.config["url"] = location
|
self.config["url"] = location
|
||||||
f.trap(f.type)
|
|
||||||
d = self.download_list(url=location)
|
d = self.download_list(url=location)
|
||||||
d.addCallbacks(self.on_download_complete, self.on_download_error)
|
d.addCallbacks(self.on_download_complete, self.on_download_error)
|
||||||
else:
|
else:
|
||||||
|
@ -258,13 +257,13 @@ class Core(CorePluginBase):
|
||||||
bl_filename = "blocklist.cache" if self.use_cache else "blocklist.download"
|
bl_filename = "blocklist.cache" if self.use_cache else "blocklist.download"
|
||||||
d = threads.deferToThread(self.update_info,
|
d = threads.deferToThread(self.update_info,
|
||||||
deluge.configmanager.get_config_dir(bl_filename))
|
deluge.configmanager.get_config_dir(bl_filename))
|
||||||
f.trap(f.type)
|
|
||||||
elif self.failed_attempts < self.config["try_times"]:
|
|
||||||
log.warning("Blocklist download failed!")
|
|
||||||
self.failed_attempts += 1
|
|
||||||
f.trap(f.type)
|
|
||||||
else:
|
else:
|
||||||
log.error(error_msg)
|
log.warning("Blocklist download failed: %s", error_msg)
|
||||||
|
if self.failed_attempts < self.config["try_times"]:
|
||||||
|
log.debug("Let's try again!")
|
||||||
|
self.failed_attempts += 1
|
||||||
|
d = self.download_list()
|
||||||
|
d.addCallbacks(self.on_download_complete, self.on_download_error)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def import_list(self, force=False):
|
def import_list(self, force=False):
|
||||||
|
@ -331,8 +330,7 @@ class Core(CorePluginBase):
|
||||||
try_again = True
|
try_again = True
|
||||||
elif os.path.exists(blocklist) and not self.use_cache:
|
elif os.path.exists(blocklist) and not self.use_cache:
|
||||||
# If we have a backup and we haven't already used it
|
# If we have a backup and we haven't already used it
|
||||||
e = f.trap(Exception)
|
log.warning("Error reading blocklist: %s", f.getErrorMessage())
|
||||||
log.warning("Error reading blocklist: %s", e)
|
|
||||||
self.use_cache = True
|
self.use_cache = True
|
||||||
try_again = True
|
try_again = True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue