From 5ce4d0000bb12353344448c334c9d525fbd34cdb Mon Sep 17 00:00:00 2001 From: timerzz Date: Tue, 3 Sep 2024 14:01:38 +0800 Subject: [PATCH] =?UTF-8?q?feat=20cron=20=E6=98=BE=E7=A4=BA=E4=B8=8B?= =?UTF-8?q?=E6=AC=A1=E8=BF=90=E8=A1=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/cron/cron.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cron/cron.go b/pkg/cron/cron.go index fbb01d0..c0bef2b 100644 --- a/pkg/cron/cron.go +++ b/pkg/cron/cron.go @@ -3,6 +3,8 @@ package cron import ( "context" "time" + + "github.com/golang/glog" ) type Cron struct { @@ -45,6 +47,7 @@ func (c *Cron) Run(ctx context.Context) { if time.Now().After(c.time) { c.time = c.time.Add(time.Hour * 24) } + glog.Infof("cron 下次运行时间: %s", c.time) select { case <-time.After(time.Until(c.time)): if c.f != nil {