握り潰したエラー表示
このコミットが含まれているのは:
@@ -295,10 +295,10 @@ async def reconnect_db (
|
|||||||
try:
|
try:
|
||||||
ensure_mysql_alive ()
|
ensure_mysql_alive ()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
if getattr (ex, 'args', [None])[0] in (2006, 2013):
|
if getattr (ex, 'args', [None])[0] not in (2006, 2013):
|
||||||
safe_reconnect ()
|
|
||||||
else:
|
|
||||||
raise
|
raise
|
||||||
|
print (f"[reconnect_db] { type (ex).__name__ }: { ex }")
|
||||||
|
safe_reconnect ()
|
||||||
|
|
||||||
|
|
||||||
def ensure_mysql_alive (
|
def ensure_mysql_alive (
|
||||||
@@ -314,6 +314,7 @@ def safe_reconnect (
|
|||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
if getattr (ex, 'args', [None])[0] not in (2006, 2013):
|
if getattr (ex, 'args', [None])[0] not in (2006, 2013):
|
||||||
raise
|
raise
|
||||||
|
print (f"[safe_reconnect] { type (ex).__name__ }: { ex }")
|
||||||
|
|
||||||
|
|
||||||
def run_with_mysql_retry (
|
def run_with_mysql_retry (
|
||||||
@@ -327,11 +328,11 @@ def run_with_mysql_retry (
|
|||||||
ensure_mysql_alive ()
|
ensure_mysql_alive ()
|
||||||
return fn (*args, **kwargs)
|
return fn (*args, **kwargs)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
if getattr (ex, 'args', [None])[0] not in (2006, 2013):
|
||||||
|
raise
|
||||||
last = ex
|
last = ex
|
||||||
if getattr (ex, 'args', [None])[0] in (2006, 2013):
|
print (f"[run_with_mysql_retry] { type (ex).__name__ }: { ex }")
|
||||||
safe_reconnect ()
|
safe_reconnect ()
|
||||||
continue
|
|
||||||
raise
|
|
||||||
if last:
|
if last:
|
||||||
raise last
|
raise last
|
||||||
|
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする