aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/server.rb')
-rw-r--r--lib/mauve/server.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/mauve/server.rb b/lib/mauve/server.rb
index eb5872b..3d59049 100644
--- a/lib/mauve/server.rb
+++ b/lib/mauve/server.rb
@@ -103,7 +103,7 @@ module Mauve
end
def start
- self.state = :starting
+# self.state = :starting
self.setup
@@ -123,6 +123,14 @@ 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.
+ #
+ 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."
+ klass.instance.stop
+ end
+
#
# Do nothing if we're frozen or supposed to be stopping or still alive!
#