Browse Source

Remove double logging by articlecache (in load_data, save_data).

tags/0.6.0
ShyPike 15 years ago
parent
commit
a32fa30694
  1. 8
      sabnzbd/__init__.py
  2. 3
      sabnzbd/articlecache.py

8
sabnzbd/__init__.py

@ -685,7 +685,8 @@ def get_new_id(prefix, folder, check_list=None):
@synchronized(IO_LOCK)
def save_data(data, _id, path, do_pickle = True, silent=False):
logging.info("Saving data for %s in %s", _id, path)
if not silent:
logging.debug("Saving data for %s in %s", _id, path)
path = os.path.join(path, _id)
try:
@ -702,14 +703,15 @@ def save_data(data, _id, path, do_pickle = True, silent=False):
@synchronized(IO_LOCK)
def load_data(_id, path, remove=True, do_pickle=True):
def load_data(_id, path, remove=True, do_pickle=True, silent=False):
path = os.path.join(path, _id)
if not os.path.exists(path):
logging.info("%s missing", path)
return None
logging.info("Loading data for %s from %s", _id, path)
if not silent:
logging.debug("Loading data for %s from %s", _id, path)
try:
_f = open(path, 'rb')

3
sabnzbd/articlecache.py

@ -103,7 +103,8 @@ class ArticleCache(object):
if sabnzbd.LOG_ALL:
logging.debug("Loaded %s from cache", article)
elif article.art_id:
data = sabnzbd.load_data(article.art_id, nzo.workpath, remove=True, do_pickle=False)
data = sabnzbd.load_data(article.art_id, nzo.workpath, remove=True,
do_pickle=False, silent=True)
if article in nzo.saved_articles:
nzo.saved_articles.remove(article)

Loading…
Cancel
Save