Skip to content

Commit

Permalink
fix: Pass if db.cursor.close failed
Browse files Browse the repository at this point in the history
To see actual error reason in log.
  • Loading branch information
terayamaaaa committed Oct 6, 2023
1 parent ef4d413 commit 2735f00
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions template/jupyterhub/jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,12 @@ def get_course_students(shortname):
except pymysql.Warning as w:
logger.warn(w)
finally:
# 例外の有無に関わらずカーソルと接続を閉じる
cur.close()
conn.close()
try:
# 例外の有無に関わらずカーソルと接続を閉じる
cur.close()
conn.close()
except Exception:
pass

return active_student_list

Expand Down

0 comments on commit 2735f00

Please sign in to comment.