Class: BackupClient::Components::Tasks::Commands::Processor
- Inherits:
-
Object
- Object
- BackupClient::Components::Tasks::Commands::Processor
- Includes:
- Helpers::LogHelper
- Defined in:
- lib/backup_client/components/tasks/commands/processor.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(task, config:) ⇒ Processor
constructor
A new instance of Processor.
Methods included from Helpers::LogHelper
Constructor Details
#initialize(task, config:) ⇒ Processor
Returns a new instance of Processor.
10 11 12 13 14 15 16 |
# File 'lib/backup_client/components/tasks/commands/processor.rb', line 10 def initialize(task, config:) @task = task @providers = config["providers"] @source_paths = task["paths"] @use_timestamp = task.fetch("timestamped_subfolder", true) @timestamp = Time.now.strftime("%Y-%m-%d-%H-%M-%S") end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/backup_client/components/tasks/commands/processor.rb', line 18 def call log("Processing task #{task["name"]}") task["providers"].each do |task_provider| provider = fetch_provider(task_provider) next if provider.nil? log("Processing provider #{task_provider['name']}#{task_provider['type']}") processing_task_for_provider(provider) # rescue StandardError => e # log(" Unexpected error: #{e}, #{provider["type"].upcase}: #{provider["name"].upcase}") end end |