#feature: some update
This commit is contained in:
@@ -23,6 +23,7 @@ class ScheduledTaskService
|
||||
try {
|
||||
self::$configServiceInstance ??= app(ConfigService::class);
|
||||
$enabled = self::$configServiceInstance->get(self::CONFIG_KEY, []);
|
||||
|
||||
return $enabled[$name] ?? false;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
@@ -70,7 +71,7 @@ class ScheduledTaskService
|
||||
}
|
||||
}
|
||||
|
||||
if (!$exists) {
|
||||
if (! $exists) {
|
||||
throw new \InvalidArgumentException("未知任务: {$name}");
|
||||
}
|
||||
|
||||
@@ -111,8 +112,10 @@ class ScheduledTaskService
|
||||
if (str_contains($command, 'artisan')) {
|
||||
$command = preg_replace('/^.*artisan\s+/', '', $command);
|
||||
}
|
||||
|
||||
return trim(str_replace("'", '', $command));
|
||||
}
|
||||
|
||||
return 'closure';
|
||||
}
|
||||
|
||||
@@ -132,9 +135,11 @@ class ScheduledTaskService
|
||||
'0 0 * * *' => '每天凌晨 0:00',
|
||||
'0 2 * * *' => '每天凌晨 2:00',
|
||||
'0 3 * * *' => '每天凌晨 3:00',
|
||||
'0 8 * * *' => '每天早上 08:00',
|
||||
'0 0 * * 0' => '每周日凌晨',
|
||||
'0 0 1 * *' => '每月 1 日凌晨',
|
||||
];
|
||||
|
||||
return $map[$expression] ?? $expression;
|
||||
}
|
||||
|
||||
@@ -149,9 +154,11 @@ class ScheduledTaskService
|
||||
'daily-log-analysis' => 'SLS 日志分析 - 每日分析过去 24 小时日志',
|
||||
'frequent-log-analysis' => 'SLS 日志分析 - 定期分析过去 6 小时日志',
|
||||
'jenkins-monitor' => 'Jenkins 发布监控 - 检查新构建并发送通知',
|
||||
'erp-request-report' => 'ERP 请求日报 - 汇总前一天 OpenAPI 请求并发送钉钉',
|
||||
'scheduled-task-refresh' => '定时任务管理 - 刷新定时任务列表',
|
||||
'logs-cleanup' => '日志清理 - 自动删除 7 天前的定时任务日志',
|
||||
];
|
||||
|
||||
return $descriptions[$name] ?? $name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user