How to execute actions at a given time using Ruby on Rails

0

In my project I would like to create alerts that run at every given interval or on a certain date, Any way to do it, using as little memory as possible?

    
asked by anonymous 25.12.2014 / 22:34

1 answer

3

You have some alternatives to running a scheduled task.

Remembering that to do this I recommend isolating what you want to perform on a rake task , so the call is accessed more easily by the console.

1) Use the operating system CRON, which you can do the scheduling by OS and it will execute a command according to the specified schedule, in the RUBY environment has the gem whenever that helps in this process but is worth reading about crontab of linux

2) You can use the sidekiq to do the scheduling there is a gem sidetiq that makes this schedule linked to sidekiq

3) If you will use a PAAS like heroku, they have tools to do this schedule through their platform, since the programmer does not have as much access to the OS.

    
07.01.2015 / 04:55