From ad32a2ef3cc508d6540b16a762dec31b773818c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=B5=D0=BA=D0=BB=D0=B5=D0=BC=D0=B8=D1=88=D0=B5?= =?UTF-8?q?=D0=B2=20=D0=9F=D0=B5=D1=82=D1=80=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 31 May 2024 13:26:23 +0700 Subject: [PATCH] Drop mysql restarts --- backend/apps/webui/internal/wrappers.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/backend/apps/webui/internal/wrappers.py b/backend/apps/webui/internal/wrappers.py index 406599b5a..53869b916 100644 --- a/backend/apps/webui/internal/wrappers.py +++ b/backend/apps/webui/internal/wrappers.py @@ -1,8 +1,8 @@ from contextvars import ContextVar -from peewee import PostgresqlDatabase, InterfaceError as PeeWeeInterfaceError, MySQLDatabase, _ConnectionState +from peewee import PostgresqlDatabase, InterfaceError as PeeWeeInterfaceError, _ConnectionState from playhouse.db_url import register_database -from playhouse.pool import PooledPostgresqlDatabase, PooledMySQLDatabase +from playhouse.pool import PooledPostgresqlDatabase from playhouse.shortcuts import ReconnectMixin from psycopg2 import OperationalError from psycopg2.errors import InterfaceError @@ -26,7 +26,7 @@ class PeeweeConnectionState(_ConnectionState): class CustomReconnectMixin(ReconnectMixin): reconnect_errors = ( - # default ReconnectMixin exceptions (MySQL specific) + # default ReconnectMixin exceptions *ReconnectMixin.reconnect_errors, # psycopg2 (OperationalError, 'termin'), @@ -44,16 +44,6 @@ class ReconnectingPooledPostgresqlDatabase(CustomReconnectMixin, PooledPostgresq pass -class ReconnectingMySQLDatabase(CustomReconnectMixin, MySQLDatabase): - pass - - -class ReconnectingPooledMySQLDatabase(CustomReconnectMixin, PooledMySQLDatabase): - pass - - def register_peewee_databases(): - register_database(MySQLDatabase, 'mysql') - register_database(PooledMySQLDatabase, 'mysql+pool') register_database(ReconnectingPostgresqlDatabase, 'postgres', 'postgresql') register_database(ReconnectingPooledPostgresqlDatabase, 'postgres+pool', 'postgresql+pool')