Navigation Menu

Skip to content

Commit

Permalink
Do only one thing at one line
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 22, 2015
1 parent 7bb199e commit 6b5f625
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/droonga/forward_buffer.rb
Expand Up @@ -64,12 +64,15 @@ def add(message, destination)

def start_forward
logger.trace("start_forward: start")
forwarded = false
n_forwarded_messages = 0
Pathname.glob("#{@data_directory}/*#{SUFFIX}").collect do |buffered_message_path|
forwarded = forward(buffered_message_path) || forwarded
forwarded = forward(buffered_message_path)
n_forwarded_messages += 1 if forwarded
end
if @process_messages_newer_than_timestamp and forwarded
logger.info("New message is detected and forwarded. The boundary is now cleared.")
if n_forwarded_messages > 0 and
@process_messages_newer_than_timestamp
logger.info("#{n_forwarded_messages} new messages forwarded. " +
"The boundary is now cleared.")
@process_messages_newer_than_timestamp = nil
end
@serf.reset_have_unprocessed_messages_for(@target)
Expand Down

0 comments on commit 6b5f625

Please sign in to comment.