I have no problem with the scheduling of the script. I really want to
understand how people are writing the scripts themselves share the
existing database connections and use active record. For instance:
I think you’re looking for difficulties where there are none.
The script run by cron (for example) will have its own database
connection, just as each of your mongrels/fcgi listeners has one, and
can use ActiveRecord just as your controllers would or you would from
script/console.
I solved that one, and re-used the connection. I did it the extra-sick
way.
I wrote a private action, available only in non-production mode, and
then I
hit it with a simulated web browser.
There’s a less-sick way, right?
But all the pieces were just laying around, tempting me, saying “put me
together like thiiiiis!!”
I have no problem with the scheduling of the script. I really want to
understand how people are writing the scripts themselves share the
existing database connections and use active record. For instance:
Periodic web service invocation.
External script.
This is Rails - you don’t share anything other than the database
itself. Batch scripts and offload scripts run in their own separate
process space unhindered by the Web facing application processes.
I think you’re looking for difficulties where there are none.
The script run by cron (for example) will have its own database
connection, just as each of your mongrels/fcgi listeners has one, and
can use ActiveRecord just as your controllers would or you would from
script/console.
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.