aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/server.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-07-03 15:26:51 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-07-03 15:26:51 +0100
commit5bfb713e39fde3778f57cb33f90157fc870bf64b (patch)
treeb8bbb095916a935471a2c7d16e19c263c15989c1 /lib/mauve/server.rb
parent4153ce040ccc82421865438a32fe7e17d9739ac6 (diff)
Removed ability to freeze threads, since that is not used any more.
Added checks to make sure threads are run at least every two minutes.
Diffstat (limited to 'lib/mauve/server.rb')
-rw-r--r--lib/mauve/server.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/mauve/server.rb b/lib/mauve/server.rb
index 4a496b5..630a201 100644
--- a/lib/mauve/server.rb
+++ b/lib/mauve/server.rb
@@ -246,10 +246,10 @@ module Mauve
thread_list.delete(klass.instance.thread)
#
- # Make sure that if the thread is frozen, that we've not been frozen for too long.
+ # Check every couple of minutes that the thread is still running.
#
- if klass.instance.state != :started and klass.instance.last_state_change.is_a?(Time) and klass.instance.last_state_change < (Time.now - 2.minutes)
- logger.warn "#{klass} has been #{klass.instance.state} since #{klass.instance.last_state_change}. Killing and restarting."
+ if klass.instance.state == :started and klass.instance.last_polled_at.is_a?(Time) and klass.instance.last_polled_at < (Time.now - 2.minutes)
+ logger.warn "#{klass} has not run its loop since #{klass.instance.last_polled_at}. Killing and restarting."
klass.instance.stop
end