Skip to content

Instantly share code, notes, and snippets.

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):
db = RetryDB('app')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment