Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created August 18, 2016 00:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/287beb57dacfb70306fac4d0afc7c25d to your computer and use it in GitHub Desktop.
Save kurozumi/287beb57dacfb70306fac4d0afc7c25d to your computer and use it in GitHub Desktop.
【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