Changed error logging in core_pe.cache because it would sometimes result in huge logs of no value. Also, added debug logging during the analysis of pictures.

This commit is contained in:
Virgil Dupras 2011-01-29 11:31:17 +01:00
parent e150b26cab
commit c5bf0f228a
2 changed files with 4 additions and 3 deletions

View File

@ -81,9 +81,9 @@ class Cache(object):
try:
self.con.execute(sql, [value, key])
except sqlite.OperationalError:
logging.warning('Picture cache could not set %r for key %r', value, key)
logging.warning('Picture cache could not set value for key %r', key)
except sqlite.DatabaseError as e:
logging.warning('DatabaseError while setting %r for key %r: %s', value, key, str(e))
logging.warning('DatabaseError while setting value for key %r: %s', key, str(e))
def _create_con(self, second_try=False):
def create_tables():

View File

@ -34,8 +34,9 @@ def prepare_pictures(pictures, cache_path, j=job.nulljob):
prepared = [] # only pictures for which there was no error getting blocks
try:
for picture in j.iter_with_progress(pictures, tr("Analyzed %d/%d pictures")):
picture.dimensions
picture.unicode_path = str(picture.path)
logging.debug("Analyzing picture at {}".format(picture.unicode_path))
picture.dimensions # pre-read dimensions
try:
if picture.unicode_path not in cache:
blocks = picture.get_blocks(BLOCK_COUNT_PER_SIDE)