mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-08 08:11:31 +08:00
fix
This commit is contained in:
@@ -78,7 +78,3 @@ class SystemConfigOper(DbOper, metaclass=Singleton):
|
|||||||
if conf:
|
if conf:
|
||||||
conf.delete(self._db, conf.id)
|
conf.delete(self._db, conf.id)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
if self._db:
|
|
||||||
self._db.close()
|
|
||||||
|
|||||||
@@ -50,10 +50,6 @@ class UserConfigOper(DbOper, metaclass=Singleton):
|
|||||||
return self.__get_config_caches(username=username)
|
return self.__get_config_caches(username=username)
|
||||||
return self.__get_config_cache(username=username, key=key)
|
return self.__get_config_cache(username=username, key=key)
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
if self._db:
|
|
||||||
self._db.close()
|
|
||||||
|
|
||||||
def __set_config_cache(self, username: str, key: str, value: Any):
|
def __set_config_cache(self, username: str, key: str, value: Any):
|
||||||
"""
|
"""
|
||||||
设置配置缓存
|
设置配置缓存
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from app.utils.singleton import Singleton
|
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
|
from app.utils.singleton import Singleton
|
||||||
|
|
||||||
|
|
||||||
class ThreadHelper(metaclass=Singleton):
|
class ThreadHelper(metaclass=Singleton):
|
||||||
@@ -28,6 +27,3 @@ class ThreadHelper(metaclass=Singleton):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
self.pool.shutdown()
|
self.pool.shutdown()
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self.shutdown()
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class SingletonClass(abc.ABCMeta, type):
|
|||||||
|
|
||||||
def __call__(cls, *args, **kwargs):
|
def __call__(cls, *args, **kwargs):
|
||||||
if cls not in cls._instances:
|
if cls not in cls._instances:
|
||||||
cls._instances[cls] = super(SingletonClass, cls).__call__(*args, **kwargs)
|
cls._instances[cls] = super().__call__(*args, **kwargs)
|
||||||
return cls._instances[cls]
|
return cls._instances[cls]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user