|
|
@@ -79,7 +79,7 @@ func (c taskCron) Run() {
|
|
|
// 校验当前时间
|
|
|
remindTime := gtime.NewFromStr(fmt.Sprintf("%v %v:%v:%v", now.Format("Y-m-d"), rules[2], rules[1], rules[0]))
|
|
|
// 10分钟一次定时循环,两者相差在10分钟之内(纳秒转换1e9)
|
|
|
- if (remindTime.Nanosecond()-now.Nanosecond())/(1*60*1e9) <= 10 {
|
|
|
+ if (now.Nanosecond() - remindTime.Nanosecond())/(1*60*1e9) <= 10 && now.Nanosecond() > remindTime.Nanosecond() {
|
|
|
taskNotifyMessage(task.MainUserId, task.OwnerUserId, task.TaskTitle+"督办需要处理,请前往执行")
|
|
|
}
|
|
|
} else if rules[3] == "?" { // 每周提醒
|
|
|
@@ -96,7 +96,7 @@ func (c taskCron) Run() {
|
|
|
// 校验当前时间
|
|
|
remindTime := gtime.NewFromStr(fmt.Sprintf("%v %v:%v:%v", now.Format("Y-m-d"), rules[2], rules[1], rules[0]))
|
|
|
// 10分钟一次定时循环,两者相差在10分钟之内(纳秒转换1e9)
|
|
|
- if (remindTime.Nanosecond()-now.Nanosecond())/(1*60*1e9) <= 10 {
|
|
|
+ if (now.Nanosecond() - remindTime.Nanosecond())/(1*60*1e9) <= 10 && now.Nanosecond() > remindTime.Nanosecond() {
|
|
|
taskNotifyMessage(task.MainUserId, task.OwnerUserId, task.TaskTitle+"督办需要处理,请前往执行")
|
|
|
}
|
|
|
}
|
|
|
@@ -113,7 +113,7 @@ func (c taskCron) Run() {
|
|
|
// 校验当前时间
|
|
|
remindTime := gtime.NewFromStr(fmt.Sprintf("%v %v:%v:%v", now.Format("Y-m-d"), rules[2], rules[1], rules[0]))
|
|
|
// 10分钟一次定时循环,两者相差在10分钟之内(纳秒转换1e9)
|
|
|
- if (remindTime.Nanosecond()-now.Nanosecond())/(1*60*1e9) <= 10 {
|
|
|
+ if (now.Nanosecond() - remindTime.Nanosecond())/(1*60*1e9) <= 10 && now.Nanosecond() > remindTime.Nanosecond() {
|
|
|
taskNotifyMessage(task.MainUserId, task.OwnerUserId, task.TaskTitle+"督办需要处理,请前往执行")
|
|
|
}
|
|
|
}
|