Michaël wrote:
> On Aug 3, 1:24�pm, Marnen Laibow-Koser <[email protected]> wrote:
>>
>> > Many thanks,
>> > Micha l

[Please quote what you're replying to.  It will make the discussion 
easier to follow.]

> 
> Because the application I'm maintaining uses Model find() methods to
> run large queries on the database to produce reports. These queries
> can take upwards of 10 minutes due to some complex table joins. While
> I'm altering the way these are working so they're not taking a large
> amount of time, I need an interim solution where I monitor the
> database for any of these queries that are taking more than a set
> maximum time, killing the thread of those queries that are going over
> the threshold and recording which query was killed so it can be re-run
> at a quieter time.

Your database should already do this.  You don't need to do it from 
Rails.

> It would be really useful if, when one of these
> large finds is run, that I could record the thread ID it creates so if
> I need to kill a thread, I can match it back up to the originating
> find() call.

If the database kills a thread, can't you just rescue the appropriate 
exception?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to