Class: GroongaDelta::LocalVacuumer
- Inherits:
-
Object
- Object
- GroongaDelta::LocalVacuumer
- Defined in:
- lib/groonga-delta/local-vacuumer.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ LocalVacuumer
constructor
A new instance of LocalVacuumer.
- #vacuum ⇒ Object
Constructor Details
#initialize(config) ⇒ LocalVacuumer
Returns a new instance of LocalVacuumer.
22 23 24 25 26 |
# File 'lib/groonga-delta/local-vacuumer.rb', line 22 def initialize(config) @logger = config.logger @delta_dir = config.delta_dir @config = config.vacuum end |
Instance Method Details
#vacuum ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/groonga-delta/local-vacuumer.rb', line 28 def vacuum keep_span = @config.keep_span return if keep_span.nil? return if keep_span < 0 reader = LocalReader.new(@logger, @delta_dir) = Time.now.utc - keep_span reader.each(nil, ) do |target| target.vacuum(@logger) end end |