Fix bridge (https://github.com/DMOJ/online-judge/pull/2080)
This commit is contained in:
parent
304fa0e0f3
commit
7d5efa60c7
3 changed files with 13 additions and 6 deletions
|
@ -36,10 +36,7 @@ SubmissionData = namedtuple(
|
|||
|
||||
|
||||
def _ensure_connection():
|
||||
try:
|
||||
db.connection.cursor().execute("SELECT 1").fetchall()
|
||||
except Exception:
|
||||
db.connection.close()
|
||||
db.connection.close_if_unusable_or_obsolete()
|
||||
|
||||
|
||||
class JudgeHandler(ZlibPacketHandler):
|
||||
|
@ -903,3 +900,6 @@ class JudgeHandler(ZlibPacketHandler):
|
|||
"language": data["language__key"],
|
||||
},
|
||||
)
|
||||
|
||||
def on_cleanup(self):
|
||||
db.connection.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue