mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
添加安装版本统计上报
This commit is contained in:
@@ -36,6 +36,7 @@ from app.db.systemconfig_oper import SystemConfigOper
|
||||
from app.helper.image import WallpaperHelper
|
||||
from app.helper.message import MessageHelper
|
||||
from app.helper.sites import SitesHelper # noqa
|
||||
from app.helper.usage import UsageHelper
|
||||
from app.log import logger
|
||||
from app.schemas import Notification, NotificationType, Workflow
|
||||
from app.schemas.types import EventType, SystemConfigKey
|
||||
@@ -264,6 +265,7 @@ class Scheduler(ConfigReloadMixin, metaclass=SingletonClass):
|
||||
"DATA_CLEANUP_DOWNLOAD_HISTORY_DAYS",
|
||||
"DATA_CLEANUP_SITE_USERDATA_DAYS",
|
||||
"DATA_CLEANUP_TRANSFER_HISTORY_DAYS",
|
||||
"USAGE_STATISTIC_SHARE",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
@@ -401,6 +403,11 @@ class Scheduler(ConfigReloadMixin, metaclass=SingletonClass):
|
||||
"func": self.agent_heartbeat,
|
||||
"running": False,
|
||||
},
|
||||
"usage_report": {
|
||||
"name": "安装版本统计上报",
|
||||
"func": UsageHelper().report,
|
||||
"running": False,
|
||||
},
|
||||
}
|
||||
|
||||
# 创建定时服务
|
||||
@@ -644,6 +651,17 @@ class Scheduler(ConfigReloadMixin, metaclass=SingletonClass):
|
||||
kwargs={"job_id": "agent_heartbeat"},
|
||||
)
|
||||
|
||||
# 安装版本统计上报
|
||||
if settings.USAGE_STATISTIC_SHARE:
|
||||
self._scheduler.add_job(
|
||||
self.start,
|
||||
"interval",
|
||||
id="usage_report",
|
||||
name="安装版本统计上报",
|
||||
hours=24,
|
||||
kwargs={"job_id": "usage_report"},
|
||||
)
|
||||
|
||||
# 初始化工作流服务
|
||||
self.init_workflow_jobs()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user