feat 新增清理TMDB缓存命令
This commit is contained in:
@ -406,3 +406,9 @@ class ChainBase(metaclass=ABCMeta):
|
||||
定时任务,每10分钟调用一次,模块实现该接口以实现定时服务
|
||||
"""
|
||||
return self.run_module("scheduler_job")
|
||||
|
||||
def clear_cache(self) -> None:
|
||||
"""
|
||||
清理缓存,模块实现该接口响应清理缓存事件
|
||||
"""
|
||||
return self.run_module("clear_cache")
|
||||
|
17
app/chain/system.py
Normal file
17
app/chain/system.py
Normal file
@ -0,0 +1,17 @@
|
||||
from typing import Union
|
||||
|
||||
from app.chain import ChainBase
|
||||
from app.schemas import Notification, MessageChannel
|
||||
|
||||
|
||||
class SystemChain(ChainBase):
|
||||
"""
|
||||
系统级处理链
|
||||
"""
|
||||
def remote_clear_cache(self, channel: MessageChannel, userid: Union[int, str]):
|
||||
"""
|
||||
清理系统缓存
|
||||
"""
|
||||
self.clear_cache()
|
||||
self.post_message(Notification(channel=channel,
|
||||
title=f"缓存清理完成!", userid=userid))
|
Reference in New Issue
Block a user