Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JobEntry.exec time error(2021-11-10 10:00:00 +0800 +0800 not equal 2021-11-10 10:00:00.005917627 +0800 CST #123

Open
leeyisoft opened this issue Dec 24, 2021 · 2 comments

Comments

@leeyisoft
Copy link

Describe the bug
老是报如下提示,看了golang源码,还是不知道如何解决问题,也不知道为什么要报这“告警内容”,求解

  • 告警内容:2021/11/10 10:00:00 job.go:469: �[31m[ERROR]�[0m {此处为:j.detail.Name}(36) JobEntry.exec time error(2021-11-10 10:00:00 +0800 +0800 not equal 2021-11-10 10:00:00.005917627 +0800 CST m=+2735550.456540623)

软件版本 : jiacrontab v2.1.0 (built w/go1.15.5)
系统信息:

cat /etc/issue
Debian GNU/Linux 10 \n \l

cat /etc/timezone
Asia/Shanghai

这源码不是很理解

			// 数据库中记录的执行时刻等于计时器中的时刻和现在的时刻才允许执行
			execTime := j.detail.NextExecTime.Truncate(time.Second)
			if !(execTime.Equal(j.job.GetNextExecTime().Truncate(time.Second)) && execTime.Equal(now.Truncate(time.Second))) {
				log.Errorf("%s(%d) JobEntry.exec time error(%s not equal %s)",
					j.detail.Name, j.detail.ID, execTime, now)
				j.jd.addJob(&crontab.Job{
					ID:      j.detail.ID,
					Second:  j.detail.TimeArgs.Second,
					Minute:  j.detail.TimeArgs.Minute,
					Hour:    j.detail.TimeArgs.Hour,
					Day:     j.detail.TimeArgs.Day,
					Month:   j.detail.TimeArgs.Month,
					Weekday: j.detail.TimeArgs.Weekday,
				}, false)
				return
			}
@iwannay
Copy link
Owner

iwannay commented Jan 18, 2022

主要是用于校验执行时间和当前时间是否一致的,如果不一致则禁止执行。

@leeyisoft
Copy link
Author

主要是用于校验执行时间和当前时间是否一致的,如果不一致则禁止执行。

我观察到的结果是: 抛出了这个错误之后,定时任务还是执行了的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants