-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
egg-schedule: 超过一定范围无效 #709
Comments
你不是用egg-schedule 的 cron 方式? |
@strawberry224 这类的定时任务确定不是你设计有问题?你的服务会超过一个月都不重启么?�用 cron 类型的 schedule 吧 |
好像是有问题,cron 也是转 setTimeout |
|
https://github.com/nodejs/node/blob/master/lib/timers.js#L32 node 有做这个限制,大概是 24 天,egg-schedule 不支持设置超过这个长度的定时任务,我会去加 egg-schedule 加一下报错提示 |
应该是不支持两次间隔超过 24 天,只能设置小一点。自己判断了 |
@atian25 谢谢大家的解答,由于业务量不大,我本想一个月清除一次临时图片文件,这个设计确实存在问题。如果不支持的话,我改小一点时间也是OK的 :)
|
@strawberry224 忘记说了,在 eggjs/schedule#19 已经解决这个问题了。 |
egg-schedule通过setTimeout来控制程序运行的间隔时间,但是其参数有限制不能超过int的范围,因此当我执行如每月执行一次的定时任务时就不会按照预期运行。
The text was updated successfully, but these errors were encountered: