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

Asked

Viewed 543 times

0

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

  • you’re talking about running a scheduled task? run every day? once a week? hourly?

1 answer

3


You have some alternatives to running a scheduled task.

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

1) Use the CRON of the operating system, which you can schedule by the OS and it will execute a command as per the specified agenda, in the RUBY environment has the Gem Whenever which helps in this process, but worth reading about crontab linux

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.