Only log last mysql exception as error, rest as warning.

This commit is contained in:
Michael Herzberg 2017-10-08 20:57:25 +01:00
parent d166815852
commit 300a8c905a
1 changed files with 1 additions and 4 deletions

View File

@ -96,10 +96,7 @@ class MysqlBackend:
).format(t + 1,
self.maxtries,
self.try_wait, factor * 100)
if t == 0:
log_exception(logmsg, 3, self.ext_id)
else:
log_error(logmsg, 3, self.ext_id)
log_warning(logmsg, 3, self.ext_id)
time.sleep(self.try_wait * uniform(
1 - factor, 1 + factor))