mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
fix(runtime): 收口调度与事件异步任务生命周期 (#6415)
This commit is contained in:
@@ -185,6 +185,7 @@ async def cookie_cloud_sync(
|
||||
|
||||
@router.get("/reset", summary="重置站点", response_model=_SchemaResponse[None])
|
||||
async def reset(
|
||||
task_registry: Annotated[TaskRegistry, Depends(get_background_task_registry)],
|
||||
command: SiteMutationCommand = Depends(get_site_mutation_command),
|
||||
_: ApiPrincipal = Depends(get_current_active_superuser_async),
|
||||
) -> Any:
|
||||
@@ -194,9 +195,12 @@ async def reset(
|
||||
result = await command.reset()
|
||||
await get_configured_system_config().async_set(SystemConfigKey.IndexerSites, [])
|
||||
await get_configured_system_config().async_set(SystemConfigKey.RssSites, [])
|
||||
# 启动定时服务
|
||||
Scheduler().start("cookiecloud", manual=True)
|
||||
# 插件站点删除
|
||||
resolve_background_task_registry(task_registry).create_sync(
|
||||
Scheduler().start,
|
||||
job_id="cookiecloud",
|
||||
owner="api.site.reset",
|
||||
manual=True,
|
||||
)
|
||||
return _SchemaResponse(success=result.success, message="站点已重置!")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user