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

Daily Job Not Perform as Expected #70

Open
shenhf opened this issue Nov 15, 2017 · 2 comments
Open

Daily Job Not Perform as Expected #70

shenhf opened this issue Nov 15, 2017 · 2 comments

Comments

@shenhf
Copy link

shenhf commented Nov 15, 2017

I created a crono job to send birthday email every day at 7:30 PM. It was supposed to run only once in one day!
Crono.perform(BirthdayJob).every 1.day, at: '07:30'

Crono started at 7:30 as expected, but after that it "LOST CONTROLL", it was performed periodically, here is the log:
I, [2017-11-11T07:30:49.583366 #21714] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:30:49.695109 #21714] INFO -- : Finished TeacherBirthdayJob in 0.11 seconds I, [2017-11-11T07:32:01.586710 #21769] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:32:01.725813 #21769] INFO -- : Finished TeacherBirthdayJob in 0.14 seconds I, [2017-11-11T07:35:37.642675 #21929] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:35:37.783441 #21929] INFO -- : Finished TeacherBirthdayJob in 0.14 seconds I, [2017-11-11T07:36:13.687404 #21955] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:36:13.824727 #21955] INFO -- : Finished TeacherBirthdayJob in 0.14 seconds I, [2017-11-11T07:36:49.663363 #21982] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:36:49.811763 #21982] INFO -- : Finished TeacherBirthdayJob in 0.15 seconds I, [2017-11-11T07:37:25.681799 #22010] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:37:25.821417 #22010] INFO -- : Finished TeacherBirthdayJob in 0.14 seconds I, [2017-11-11T07:38:01.682282 #22036] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:38:01.795722 #22036] INFO -- : Finished TeacherBirthdayJob in 0.11 seconds I, [2017-11-11T07:38:37.722369 #22063] INFO -- : Perform TeacherBirthdayJob I, [2017-11-11T07:38:37.868257 #22063] INFO -- : Finished TeacherBirthdayJob in 0.13 seconds I, [2017-11-11T07:39:13.735050 #22089] INFO -- : Perform TeacherBirthdayJob

ps. This is a mutiple Job

Crono.perform(AccountSyncJob).every 1.minutes
Crono.perform(TeacherBirthdayJob).every 1.day #, at: '07:30'

@gastongouron
Copy link

I encountered the same problem with rake task, could you find any workaround? @shenhf

@shenhf
Copy link
Author

shenhf commented Nov 30, 2017

@gastongouron Try to truncate crono_jobs table before start crono.
You can use 'database_cleaner' gem.
And in cronotab.rb, add :
DatabaseCleaner.strategy = :truncation, {:only => %w[crono_jobs]}
DatabaseCleaner.clean

PS. This is not working solution . This gem has serious problem. After days of running, It turned to be uncontrollerable!!

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