Browse Source

Limit the number of TryList resets

This might cause problems, but it's worth a try. It seems we resetted the trylists so often, this would cause a lot of extra CPU cycles to try all articles again.
tags/3.2.0Beta1
Safihre 4 years ago
parent
commit
764f7df6a7
  1. 9
      sabnzbd/downloader.py
  2. 5
      sabnzbd/nzbqueue.py

9
sabnzbd/downloader.py

@ -395,11 +395,13 @@ class Downloader(Thread):
# Remove all connections to server
for nw in server.idle_threads + server.busy_threads:
self.__reset_nw(nw, "forcing disconnect", warn=False, wait=False, send_quit=False)
# Let the other servers try the articles of this server again
if nw.article:
sabnzbd.NzbQueue.reset_try_lists(nw.article)
# Make sure server address resolution is refreshed
server.info = None
sabnzbd.NzbQueue.reset_all_try_lists()
def decode(self, article, raw_data: Optional[List[bytes]]):
"""Decode article and check the status of
the decoder and the assembler
@ -480,7 +482,6 @@ class Downloader(Thread):
if newid:
self.init_server(None, newid)
self.__restart -= 1
sabnzbd.NzbQueue.reset_all_try_lists()
# Have to leave this loop, because we removed element
break
else:
@ -723,7 +724,7 @@ class Downloader(Thread):
server.active = False
if penalty and (block or server.optional):
self.plan_server(server, penalty)
sabnzbd.NzbQueue.reset_all_try_lists()
sabnzbd.NzbQueue.reset_try_lists(article)
self.__reset_nw(nw, None, warn=False, send_quit=True)
continue
except:

5
sabnzbd/nzbqueue.py

@ -480,7 +480,6 @@ class NzbQueue:
if nzo_id in self.__nzo_table:
nzo = self.__nzo_table[nzo_id]
nzo.resume()
nzo.reset_all_try_lists()
logging.info("Resumed nzo: %s", nzo_id)
handled.append(nzo_id)
return handled
@ -694,10 +693,6 @@ class NzbQueue:
article.nzf.reset_try_list()
article.nzf.nzo.reset_try_list()
def reset_all_try_lists(self):
for nzo in self.__nzo_list:
nzo.reset_all_try_lists()
def has_forced_items(self):
"""Check if the queue contains any Forced
Priority items to download while paused

Loading…
Cancel
Save