Created
August 18, 2016 00:13
-
-
Save kurozumi/287beb57dacfb70306fac4d0afc7c25d to your computer and use it in GitHub Desktop.
【Python】peeweeでError 2006: MySQL server has gone awayとなったときに再接続させる方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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