YUKI Hiroshi
null+****@clear*****
Thu Oct 31 18:35:34 JST 2013
YUKI Hiroshi 2013-10-31 18:35:34 +0900 (Thu, 31 Oct 2013) New Revision: 2e1fdc9d49f34660633881ed91cfee00e4ec23e3 https://github.com/droonga/fluent-plugin-droonga/commit/2e1fdc9d49f34660633881ed91cfee00e4ec23e3 Message: Accept :now option to specify expiration time Modified files: lib/droonga/sweeper.rb Modified: lib/droonga/sweeper.rb (+4 -2) =================================================================== --- lib/droonga/sweeper.rb 2013-10-31 18:27:24 +0900 (0a54a79) +++ lib/droonga/sweeper.rb 2013-10-31 18:35:34 +0900 (fb1f332) @@ -34,8 +34,9 @@ module Droonga end end - def sweep_expired_subscribers - boundary = Time.now - SUBSCRIBER_LIFETIME_SECONDS + def sweep_expired_subscribers(options={}) + now = options[:now] || Time.now + boundary = now - SUBSCRIBER_LIFETIME_SECONDS expired_subscribers = @context["Subscriber"].select do |subscriber| subscriber.last_modified < boundary end @@ -44,6 +45,7 @@ module Droonga end end + private def watcher @watcher ||= Watcher.new(@context) end -------------- next part -------------- HTML����������������������������...Download