From 841e0e351f4d3a41558ab126b2bd5c11f2834b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Fri, 5 Apr 2024 21:12:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E9=9D=A2=E6=9D=BF=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=87=BA=E9=94=99=E6=97=B6=E5=B0=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=AE=BE=E7=BD=AE=E4=B8=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/console/commands/panel_task.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/console/commands/panel_task.go b/app/console/commands/panel_task.go index 2a3008cf..d7fe2493 100644 --- a/app/console/commands/panel_task.go +++ b/app/console/commands/panel_task.go @@ -37,6 +37,7 @@ func (receiver *PanelTask) Handle(ctx console.Context) error { // 优化数据库 if _, err := facades.Orm().Query().Exec("VACUUM"); err != nil { + internal.Status = internal.StatusFailed facades.Log().Tags("面板", "每日任务"). With(map[string]any{ "error": err.Error(), @@ -46,6 +47,7 @@ func (receiver *PanelTask) Handle(ctx console.Context) error { // 备份面板 if err := tools.Archive([]string{"/www/panel"}, "/www/backup/panel/panel-"+carbon.Now().ToShortDateTimeString()+".zip"); err != nil { + internal.Status = internal.StatusFailed facades.Log().Tags("面板", "每日任务"). With(map[string]any{ "error": err.Error(), @@ -55,6 +57,7 @@ func (receiver *PanelTask) Handle(ctx console.Context) error { // 清理 7 天前的备份 if _, err := tools.Exec(`find /www/backup/panel -mtime +7 -name "*.zip" -exec rm -rf {} \;`); err != nil { + internal.Status = internal.StatusFailed facades.Log().Tags("面板", "每日任务"). With(map[string]any{ "error": err.Error(),