views:

132

answers:

1

Hi all,

In my Rails application I have a separate process (BackgroundRb) to delete all transactions which are not successful and it must be run after every five minutes. But in BackgroundRb, it runs a database check after every second though my query executes periodically at the specified time(after 5 mins). So my question is what is the best approach for this kind of scenario ? Should I use a Stored procedure in which the query is executed inside a infinite loop, not giving burden on Rails application (since BackgroundRb is accessing database at every second) or should I use a different application like Wokling to stop such frequent database access as BackgroundRb does.

+1  A: 

I'd recommend a separate script run by cron. Cron is present on every hosting.

Victor Sergienko