Navigation Menu

Skip to content

Commit

Permalink
Separate definition of enumerator for buffered messages
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 22, 2015
1 parent 6b5f625 commit f3a3347
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/droonga/forward_buffer.rb
Expand Up @@ -65,7 +65,7 @@ def add(message, destination)
def start_forward
logger.trace("start_forward: start")
n_forwarded_messages = 0
Pathname.glob("#{@data_directory}/*#{SUFFIX}").collect do |buffered_message_path|
buffered_messages.collect do |buffered_message_path|
forwarded = forward(buffered_message_path)
n_forwarded_messages += 1 if forwarded
end
Expand All @@ -79,6 +79,10 @@ def start_forward
logger.trace("start_forward: done")
end

def buffered_messages
Pathname.glob("#{@data_directory}/*#{SUFFIX}")
end

def empty?
@data_directory.children.empty?
end
Expand Down

0 comments on commit f3a3347

Please sign in to comment.