[Groonga-commit] droonga/droonga-engine at 6fcc5b4 [master] Remove codes to process effective message timestamp by the receiver side

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 7 18:57:55 JST 2015


YUKI Hiroshi	2015-04-07 18:57:55 +0900 (Tue, 07 Apr 2015)

  New Revision: 6fcc5b4cea931418fd6565a928e40fa18f65abad
  https://github.com/droonga/droonga-engine/commit/6fcc5b4cea931418fd6565a928e40fa18f65abad

  Message:
    Remove codes to process effective message timestamp by the receiver side

  Modified files:
    lib/droonga/engine.rb

  Modified: lib/droonga/engine.rb (+1 -36)
===================================================================
--- lib/droonga/engine.rb    2015-04-07 18:57:26 +0900 (17a7669)
+++ lib/droonga/engine.rb    2015-04-07 18:57:55 +0900 (e068a83)
@@ -15,8 +15,8 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-require "time"
 require "fileutils"
+
 require "droonga/engine/version"
 require "droonga/loggable"
 require "droonga/deferrable"
@@ -95,7 +95,6 @@ module Droonga
     end
 
     def process(message)
-      return unless effective_message?(message)
       @last_processed_message_timestamp = message["date"]
       @dispatcher.process_message(message)
     end
@@ -123,40 +122,6 @@ module Droonga
       logger.trace("output_last_processed_message_timestamp: done")
     end
 
-    def effective_message?(message)
-      effective_timestamp = effective_message_timestamp
-      return true if effective_timestamp.nil?
-      return true unless message["date"]
-
-      begin
-        message_timestamp = Time.parse(message["date"])
-      rescue ArgumentError
-        logger.error("failed to parse the \"date\" field of a message",
-                     :message => message)
-        return false
-      end
-
-      logger.trace("checking effective_message_timestamp (#{effective_timestamp}) vs message_timestamp(#{message_timestamp})")
-      return false if effective_timestamp >= message_timestamp
-
-      logger.info("New message at #{message_timestamp} (newer than #{effective_timestamp}) is detected. The effective timestamp is now cleared.")
-      logger.trace("deleting obsolete effective_message_timestamp: start")
-      @node_metadata.delete(:effective_message_timestamp)
-      logger.trace("deleting obsolete effective_message_timestamp: done")
-      true
-    end
-
-    def effective_message_timestamp
-      timestamp = @node_metadata.get(:effective_message_timestamp)
-      return nil unless timestamp
-
-      begin
-        Time.parse(timestamp)
-      rescue ArgumentError
-        nil
-      end
-    end
-
     def log_tag
       "engine"
     end
-------------- next part --------------
HTML����������������������������...
다운로드 



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