I've currently created a custom rake file that does the following:
1.) Checks an External Feed for "NEW" Items
2.) For each new item in the feed array,it updates my Database with a new record
3.) I've currently got it on a WHILE loop. The while loop has an (@loopcheck) instance variable that is set to true initially, and if any exception is raised. Resets it to false (so the loop ends).
Here's an example:
While(@loopcheck) do
begin
....(code here)...
rescue
Exception => e
@loopcheck = false
end
sleep(120)
End
Is this bad coding? Is there a better way to do this? Ideally, I just want to run a background task to simply check for a new feed every 2-3 mins. I looked into Starling/Workling, but that seemed a bit like overkill, and I wasn't sure about running script/runner via CRON, since it reloads the entire rails environment each time. BackgroundRB a bit overkill too? No?
Just wanted to get some ideas.