Class: DumpCleaner::Processor
- Inherits:
-
Object
- Object
- DumpCleaner::Processor
- Defined in:
- lib/dump_cleaner/processor.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Processor
constructor
A new instance of Processor.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Processor
Returns a new instance of Processor.
7 8 9 |
# File 'lib/dump_cleaner/processor.rb', line 7 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/dump_cleaner/processor.rb', line 5 def @options end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dump_cleaner/processor.rb', line 11 def run start_time = Time.now cleaner_class = case config.dump_format when "mysql_shell" Cleaners::MysqlShellDumpCleaner else raise Config::ConfigurationError, "Unsupported dump format #{config.dump_format}" end Log.debug { "Starting cleanup with #{cleaner_class}…" } cleaner = cleaner_class.new(config:, options:) cleaner.pre_cleanup cleaner.clean cleaner.post_cleanup diff = Time.now - start_time Log.info { "Finished in #{diff.div(60)}m #{(diff % 60).to_i}s." } end |