Forum: Ruby on Rails A way to handle looong executions?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E03ce853a1c3eea0682e68fdbf1ff348?d=identicon&s=25 Hunter Peress (Guest)
on 2005-12-15 19:13
(Received via mailing list)
Is there somewhere I can specify a maximum execution time for a given
request. (Eg, someone does something in my application that brings about
and infinite loop). The idea of potentially huge queries or even a
programmer mistake
is not impossible, and I have a hard time accepting that I will
release an
application that has no way of handling that.


------------------------------------------------------------------------

Hunter Peress
hunterp@sfnewmexican.com
Web Programmer
The Santa Fe New Mexican, Inc.
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2005-12-15 19:34
(Received via mailing list)
On Thu, 15 Dec 2005, Hunter Peress wrote:

> Is there somewhere I can specify a maximum execution time for a given
> request. (Eg, someone does something in my application that brings about
> and infinite loop). The idea of potentially huge queries or even a programmer
> mistake
> is not impossible, and I have a hard time accepting that I will release an
> application that has no way of handling that.

[ahoward@jib ahoward]$ ruby -e' require "timeout" and
Timeout::timeout(2){ sleep 42 } '
/dmsp/reference/ruby-1.8.1//lib/ruby/1.8/timeout.rb:42: execution
expired (Timeout::Error)
         from -e:1:in `timeout'
         from -e:1

-a
--
===============================================================================
| ara [dot] t [dot] howard [at] noaa [dot] gov
| all happiness comes from the desire for others to be happy.  all misery
| comes from the desire for oneself to be happy.
| -- bodhicaryavatara
===============================================================================
This topic is locked and can not be replied to.