Navigation Menu

Skip to content

Commit

Permalink
Export last processed timestamp for the first case correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 23, 2015
1 parent 5c5d459 commit 2faaf87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/droonga/engine.rb
Expand Up @@ -147,10 +147,11 @@ def export_last_processed_message_timestamp
logger.trace("export_last_processed_message_timestamp: start")
if @last_processed_message_timestamp
timestamp = @last_processed_message_timestamp
timestamp = timestamp.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE)
serf = Serf.new(@name)
old_timestamp = serf.last_processed_message_timestamp
if timestamp > old_timestamp
old_timestamp = Time.parse(old_timestamp) if old_timestamp
if old_timestamp.nil? or timestamp > old_timestamp
timestamp = timestamp.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE)
serf.last_processed_message_timestamp = timestamp
logger.info("exported last processed message timestamp",
:timestamp => timestamp)
Expand Down

0 comments on commit 2faaf87

Please sign in to comment.