MCPcopy Create free account
hub / github.com/deepflowio/deepflow / dailyTrigger

Method dailyTrigger

server/controller/cloud/cloud.go:382–395  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

380}
381
382func (c *Cloud) dailyTrigger() bool {
383 if c.triggerTime.IsZero() {
384 return true
385 }
386
387 now := time.Now()
388 dailyTime := time.Date(now.Year(), now.Month(), now.Day(), c.triggerTime.Hour(), c.triggerTime.Minute(), 0, 0, time.Local)
389 timeSub := now.Sub(dailyTime)
390 if timeSub >= 0 && timeSub <= time.Minute {
391 return true
392 }
393 log.Infof("now is not trigger time (%s), task (%s) not running", dailyTime.Format(common.GO_BIRTHDAY), c.basicInfo.Name, logger.NewORGPrefix(c.orgID))
394 return false
395}
396
397func (c *Cloud) run() {
398 log.Infof("cloud (%s) started", c.basicInfo.Name, logger.NewORGPrefix(c.orgID))

Callers 1

runMethod · 0.95

Calls 2

FormatMethod · 0.65
InfofMethod · 0.45

Tested by

no test coverage detected