i am new in rails, i need to run one task in rails, that means have one function, which needs to call with in a 5 minutes of time interval? Because i am working with a prototype, and its running on heroku, i couldn't run any paid addons with heroku, also i read that, heroku have one scheduler, its free, but that only work with a 10 minutes interval of time. so i am thinking of, run a thread for this prototype project, ie
here writing one thread, that needs to call a function after a 5 minutes sleep? also how can i run that thread when starting the rails server? can i start that thread and server via the proc file? is this the correct way to do this?
def test
end
t = Thread.new do
while true do
sleep 60
test()
end
end
t.join