✨ [dashboard v0.3.9] 手动即时触发计划任务

This commit is contained in:
naiba committed 2021-01-24 09:41:35 +08:00
1 parent e1f1ffb583
commit 87bc9c7a4c
10 files changed
+195 -116

No files matched your search

+2 -3
View File
@@ -13,7 +13,6 @@ import (
"github.com/naiba/nezha/cmd/dashboard/rpc"
"github.com/naiba/nezha/model"
pb "github.com/naiba/nezha/proto"
"github.com/naiba/nezha/service/alertmanager"
"github.com/naiba/nezha/service/dao"
)
@@ -90,7 +89,7 @@ func loadCrons() {
Type: model.TaskTypeCommand,
})
} else {
alertmanager.SendNotification(fmt.Sprintf("计划任务:%s,服务器:%d 离线,无法执行。", cr.Name, cr.Servers[j]), false)
dao.SendNotification(fmt.Sprintf("计划任务:%s,服务器:%d 离线,无法执行。", cr.Name, cr.Servers[j]), false)
}
}
})
@@ -106,5 +105,5 @@ func main() {
go controller.ServeWeb(dao.Conf.HTTPPort)
go rpc.ServeRPC(5555)
go rpc.DispatchTask(time.Minute * 3)
alertmanager.Start()
dao.AlertSentinelStart()
}