mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-27 11:11:07 +08:00
Rollback cache
This commit is contained in:
@@ -18,6 +18,7 @@ from starlette import status
|
|||||||
from watchfiles import watch
|
from watchfiles import watch
|
||||||
|
|
||||||
from app import schemas
|
from app import schemas
|
||||||
|
from app.core.cache import cached
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
from app.core.event import eventmanager, Event
|
from app.core.event import eventmanager, Event
|
||||||
from app.db.plugindata_oper import PluginDataOper
|
from app.db.plugindata_oper import PluginDataOper
|
||||||
@@ -913,10 +914,14 @@ class PluginManager(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
return list(self._running_plugins.keys())
|
return list(self._running_plugins.keys())
|
||||||
|
|
||||||
|
@cached(maxsize=1, ttl=1800)
|
||||||
def get_online_plugins(self, force: bool = False) -> List[schemas.Plugin]:
|
def get_online_plugins(self, force: bool = False) -> List[schemas.Plugin]:
|
||||||
"""
|
"""
|
||||||
获取所有在线插件信息
|
获取所有在线插件信息
|
||||||
"""
|
"""
|
||||||
|
if force:
|
||||||
|
self.get_online_plugins.cache_clear()
|
||||||
|
|
||||||
if not settings.PLUGIN_MARKET:
|
if not settings.PLUGIN_MARKET:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@@ -1212,11 +1217,15 @@ class PluginManager(metaclass=Singleton):
|
|||||||
|
|
||||||
return plugin
|
return plugin
|
||||||
|
|
||||||
|
@cached(maxsize=1, ttl=1800)
|
||||||
async def async_get_online_plugins(self, force: bool = False) -> List[schemas.Plugin]:
|
async def async_get_online_plugins(self, force: bool = False) -> List[schemas.Plugin]:
|
||||||
"""
|
"""
|
||||||
异步获取所有在线插件信息
|
异步获取所有在线插件信息
|
||||||
:param force: 是否强制刷新(忽略缓存)
|
:param force: 是否强制刷新(忽略缓存)
|
||||||
"""
|
"""
|
||||||
|
if force:
|
||||||
|
await self.async_get_online_plugins.cache_clear()
|
||||||
|
|
||||||
if not settings.PLUGIN_MARKET:
|
if not settings.PLUGIN_MARKET:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user