Navigation Menu

Skip to content

Commit

Permalink
Save last processed message timestamp based on messages processed whi…
Browse files Browse the repository at this point in the history
…le "graceful stop" operations
  • Loading branch information
piroor committed Apr 23, 2015
1 parent c1647f7 commit c530784
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/droonga/engine.rb
Expand Up @@ -80,10 +80,13 @@ def stop_gracefully
on_finish = lambda do
logger.trace("stop_gracefully: middle")
@export_last_processed_message_timestamp_observer.stop
export_last_processed_message_timestamp
@dispatcher.stop_gracefully do
@state.shutdown
yield
#XXX We must save last processed message timstamp
# based on forwarded/dispatched messages while
# "graceful stop" operations.
export_last_processed_message_timestamp
logger.trace("stop_gracefully: done")
end
end
Expand All @@ -100,10 +103,10 @@ def stop_gracefully
def stop_immediately
logger.trace("stop_immediately: start")
@export_last_processed_message_timestamp_observer.stop
export_last_processed_message_timestamp
@dispatcher.stop_immediately
@cluster.shutdown
@state.shutdown
export_last_processed_message_timestamp
logger.trace("stop_immediately: done")
end

Expand Down

0 comments on commit c530784

Please sign in to comment.