Closed (works as designed)
Project:
Elysia Cron
Version:
7.x-2.1
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2013 at 06:00 UTC
Updated:
8 Oct 2016 at 08:43 UTC
Jump to comment: Most recent
Comments
Comment #1
gotheric commentedI'm not sure i've undestood correctly the problem.
When you enable for the first time a module, it has no "previous runs" of cron jobs, so the normal behaviour is to run all cron jobs for the first time.
After that, next runs will follow cron rules specified.
Comment #2
tassaf commentedAha, then this is normal..
I have commented the code inside my cron functions before enabling it, then I removed these comments
Comment #3
underq commentedOmg that sucks !
If I have plan one task at 9am, I don't want that execute at 10pm just because it haven't last time execution.
Comment #4
tassaf commentedWaht do u mean?
Comment #5
underq commentedI am shocked because that mean that a cron task can be executed at any time even if this is programmed at 9am for example without user's validation.
This is important problem because for determine the next time in the futur that each task is to be run this module is based on last execution time and there are many reason for which this date can be bad.
In the code itself author try to limit this problem with a large conditional
return $now >= $next_run;But to put things into perspective this module works perfectly in a lot of use case : blog, content publication, session close, ...
Yet I would have apreciated to find something about it in comment, or readme instead spending to much time on it.
Thanks for reading me.
Comment #6
PaulDinelle commentedThis is a HUGE issue. Either there needs to be a big red warning on the Cron settings page, or this needs to be remedied.
One of our live sites just sent out 5,000 emails and completely altered all of the user accounts because there were zero warnings that cron would run automatically the first time instead of on the scheduled date.
Comment #7
jmking commentedWould it be an acceptable solution to have the last executed time set to the time the line was added? This would prevent it running the first time cron runs, but would also technically show inaccurate information on the dashboard.
I suppose this could be worked around by setting the execution count to 0, and if the execution count is zero, do not show the last executed time on the dashboard.
Should be a pretty simple patch, but I'd like to get some other opinions on the approach before moving forward.
Comment #8
tassaf commentedInside the function that will run you can comment the code before enabling the module .. when you enable it, then it will run for the first time.. after that everything will be arranged and you can uncomment the code
Comment #9
nitebreed@jmking I think your aproach is a good solution
Comment #10
Leeteq commented@jmking's suggestion is interesting.
Comment #11
kala4ek