[Groonga-commit] droonga/droonga-engine at 7938224 [master] Return actually restarted or not

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 16:11:35 JST 2015


YUKI Hiroshi	2015-04-21 16:11:35 +0900 (Tue, 21 Apr 2015)

  New Revision: 79382240e94974b7e6749f41dbd07e82a1b6a227
  https://github.com/droonga/droonga-engine/commit/79382240e94974b7e6749f41dbd07e82a1b6a227

  Message:
    Return actually restarted or not

  Modified files:
    lib/droonga/serf.rb

  Modified: lib/droonga/serf.rb (+8 -2)
===================================================================
--- lib/droonga/serf.rb    2015-04-21 16:01:43 +0900 (e9b5d88)
+++ lib/droonga/serf.rb    2015-04-21 16:11:35 +0900 (bf3b87c)
@@ -224,11 +224,17 @@ module Droonga
     def ensure_restarted(&block)
       start_time = Time.now
       previous_internal_name = get_tag("internal-name")
+      restarted = false
+
       yield # the given operation must restart the service.
-      while Time.now - start_time < CHECK_RESTARTED_TIMEOUT and
-              get_tag("internal-name") == previous_internal_name
+
+      while Time.now - start_time < CHECK_RESTARTED_TIMEOUT
+        restarted = get_tag("internal-name") == previous_internal_name
+        break if restarted
         sleep(CHECK_RESTARTED_INTERVAL)
       end
+
+      restarted
     end
 
     private
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index