brandonhilkert / sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
MIT License
2.65k stars 114 forks source link

Problens on heroku #140

Closed nonato closed 8 years ago

nonato commented 8 years ago

Hello, good morning.

I am using a gem "sucker_punch" in my application, which executes a delayed task a few hours after an object is saved in the database.

This task works fine on my development machine. But when put into production heroku, it does not.

Is there any extra configuration I need to do on heroku?

Already, thank you very much.

brandonhilkert commented 8 years ago

Heroku restarts your processes each day. In doing so, any scheduled job would be lost because they're stored in memory.

Because of this, you might considering adding a database record for the task with the intended execution time, and then using the Heroku scheduler addon to run the tasks where execution times are in the past.

nonato commented 8 years ago

Thanks!