[Groonga-commit] droonga/droonga-engine at 44b7296 [master] Process progressIntervalSeconds option expectedly

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 14 21:06:08 JST 2015


YUKI Hiroshi	2015-04-14 21:06:08 +0900 (Tue, 14 Apr 2015)

  New Revision: 44b7296fc9bf2fc28913900f5f655fb905d51b40
  https://github.com/droonga/droonga-engine/commit/44b7296fc9bf2fc28913900f5f655fb905d51b40

  Message:
    Process progressIntervalSeconds option expectedly

  Modified files:
    lib/droonga/plugins/system/absorb_data.rb

  Modified: lib/droonga/plugins/system/absorb_data.rb (+5 -3)
===================================================================
--- lib/droonga/plugins/system/absorb_data.rb    2015-04-14 20:59:08 +0900 (0e37b6c)
+++ lib/droonga/plugins/system/absorb_data.rb    2015-04-14 21:06:08 +0900 (293c30e)
@@ -63,7 +63,7 @@ module Droonga
               on_finish
             end
 
-            @start_time = Time.now
+            @previous_report_time = Time.now
 
             begin
               @n_processed_messages = 0
@@ -78,8 +78,10 @@ module Droonga
                                      "to"   => my_node_name,
                                      "type" => message["type"])
                   @n_processed_messages += 1
-                  elapsed_seconds = (Time.now - @start_time).to_i
-                  if (elapsed_seconds % progress_interval_seconds).zero?
+                  now = Time.now
+                  elapsed_seconds = (now - @previous_report_time).to_i
+                  if elapsed_seconds >= progress_interval_seconds
+                    @previous_report_time = now
                     report_progress
                   end
                 rescue Exception => exception
-------------- next part --------------
HTML����������������������������...
下載 



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