Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【Python】peeweeでError 2006: MySQL server has gone awayとなったときに再接続させる方法
from peewee import *
from playhouse.shortcuts import RetryOperationalError
class RetryDB(RetryOperationalError, MySQLDatabase):
pass
db = RetryDB('app')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment