From 5650bc90940bd850a2f44bd3b58549d6b336dcd0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 2 Jul 2005 04:52:14 +0000 Subject: r1588@asus: jeremy | 2005-07-02 03:14:45 -0700 Optional periodic garbage collection for dispatch.fcgi. Graceful exit on TERM also (a la Apache1). Ignore signals the platform does not support, such as USR1 on Windows. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1592 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/test/mocks/fcgi.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'railties/test/mocks/fcgi.rb') diff --git a/railties/test/mocks/fcgi.rb b/railties/test/mocks/fcgi.rb index 071b8e1848..59260a684f 100644 --- a/railties/test/mocks/fcgi.rb +++ b/railties/test/mocks/fcgi.rb @@ -2,11 +2,14 @@ class FCGI class << self attr_accessor :time_to_sleep attr_accessor :raise_exception + attr_accessor :each_cgi_count def each_cgi - sleep(time_to_sleep || 0) - raise raise_exception, "Something died" if raise_exception - yield "mock cgi value" + (each_cgi_count || 1).times do + sleep(time_to_sleep || 0) + raise raise_exception, "Something died" if raise_exception + yield "mock cgi value" + end end end end -- cgit v1.2.3