no way to recycle / reuse the connection instead of setting up a new
one each time ?
It should be in your send_reminder() method.
John Mettraux - http://jmettraux.wordpress.com
I guess you're using ActiveRecord 2.1.0. I've taken a look at
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.
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.
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.