I've been exploring the options for running external scripts from the Rails env. The list I have is this: Cron ScriptRunner (in the script/ dir under rails projects) RailsCron The most likely candidate for me is the ScriptRunner because my external script needs to know about a model which it has to save to the database from my Rails environment, and it needs to start running as soon as I tell it to. Unfortunately, running this external command many times in a row is a bottleneck since each ScriptRunner instance has to load up the entire rails env. What I'm wondering is what is the easiest way to create a script which knows only about the model I need to work with, and it's database location, so that my script doesn't need to load the entire Rails env. I'm thinking if I can load the activerecord gem with a slim config setup, that might work, but I'm not sure how to use activerecord outside the context of the Rail's env. Anyone else ever tackle this issue?
on 2006-04-04 06:14
on 2006-04-04 10:22
On 4/3/06, Nate A. <firstname.lastname@example.org> wrote: > script needs to know about a model which it has to save to the database > setup, that might work, but I'm not sure how to use activerecord outside > Hi Nate, To run a minimal script that just loads the activerecord gem and connects to mysql on localhost takes just over a second on my G4 powerbook, and the same amount of time on my dedicated linux server. The other option is a persistant Rails environment, of which RailsCron is the only one I am aware. Let me know how you like it. -- Kyle M. Chief Technologist E Factor Media // FN Interactive email@example.com 1-866-263-3261