mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-28 12:30:00 +00:00
Changed logging in worker thread
This commit is contained in:
parent
d9b22fd513
commit
76c3ade394
@ -161,7 +161,8 @@ class CalibreTask:
|
|||||||
self.run(*args)
|
self.run(*args)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._handleError(str(e))
|
self._handleError(str(e))
|
||||||
log.exception(e)
|
if logger.is_debug_enabled():
|
||||||
|
log.exception(e)
|
||||||
|
|
||||||
self.end_time = datetime.now()
|
self.end_time = datetime.now()
|
||||||
|
|
||||||
@ -210,10 +211,7 @@ class CalibreTask:
|
|||||||
self._progress = x
|
self._progress = x
|
||||||
|
|
||||||
def _handleError(self, error_message):
|
def _handleError(self, error_message):
|
||||||
if logger.is_debug_enabled():
|
log.error(error_message)
|
||||||
log.exception(error_message)
|
|
||||||
else:
|
|
||||||
log.error(error_message)
|
|
||||||
self.stat = STAT_FAIL
|
self.stat = STAT_FAIL
|
||||||
self.progress = 1
|
self.progress = 1
|
||||||
self.error = error_message
|
self.error = error_message
|
||||||
|
Loading…
Reference in New Issue
Block a user