Hi Jim,
no way to recycle / reuse the connection instead of setting up a new
one each time ?
It should be in your send_reminder() method.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
Hi Jim,
I guess you're using ActiveRecord 2.1.0. I've taken a look at
#remove_connection :
especially
Seems like it tries to have 1 connection per thread (it uses the
thread's object id to map the connection).
The rufus-scheduler triggers the jobs in their own threads, so as not
to block the whole scheduler. I think it matches your description of
the symptoms (too many open connections).
Thanks for finding this out, it's not a direct rufus-scheduler issue,
but I should document it anyway.
Hi Jim,
I think your solution is right, it seems that ActiveRecord is creating
a connection for each of the threads the scheduler spawns that does
work with the DB. So releasing the connection once the job is done is
a good thing.
http://jmettraux.wordpress.com/2008/09/14/the-scheduler-and-the-active_record/
This has nothing to do with the time spent working on the job. Go on
with your solution. Of course having tests is a must.