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

fix cron task run for system time is updated #506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaofeng-zerone
Copy link

reschedule the Next when the system time is adjusted to the past

reschedule the Next when the system time is adjusted to the past
@xiaofeng-zerone
Copy link
Author

now 2023-10-19 14:06:51.000220772 +0800 CST ------xf2: 2023-10-19 14:06:52 999.779228ms
wake now 2023-10-19 14:06:52.000875985 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 8 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 19 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 3 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 4 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 5 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 9 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 7 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 16 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 20 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 18 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 1 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 12 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 13 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 11 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 10 next 2023-10-19 14:06:53 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 17 next 2023-10-19 14:06:57 +0800 CST
run now 2023-10-19 14:06:52.000875985 +0800 CST entry 14 next 2023-10-19 14:06:57 +0800 CST
now 2023-10-19 14:06:52.000875985 +0800 CST ------xf2: 2023-10-19 14:06:53 999.124015ms
wake now 2023-10-19 14:06:53.000421097 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 1 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 6 next 2023-10-19 14:06:56 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 3 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 4 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 5 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 9 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 7 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 8 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 20 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 19 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 16 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 12 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 13 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 11 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 10 next 2023-10-19 14:06:54 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 15 next 2023-10-19 14:06:56 +0800 CST
run now 2023-10-19 14:06:53.000421097 +0800 CST entry 18 next 2023-10-19 14:06:54 +0800 CST
now 2023-10-19 14:06:53.000421097 +0800 CST ------xf2: 2023-10-19 14:06:54 999.578903ms
wake now 2023-10-18 13:01:01.677905322 +0800 CST
now 2023-10-18 13:01:01.677905322 +0800 CST ------xf2: 2023-10-19 14:06:54 25h5m52.322094678s

@LjtGentle
Copy link

I also have this trouble

@JHJMK
Copy link

JHJMK commented May 14, 2024

I also have this trouble
use cron.Entries()[0].Next= to change cron next excute time you want

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

Successfully merging this pull request may close these issues.

None yet

3 participants