Class: Exekutor::ConfigurationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Exekutor::ConfigurationGenerator
- Defined in:
- lib/generators/exekutor/configuration_generator.rb
Overview
Generates a YAML configuration file
Instance Method Summary collapse
-
#create_configuration_file ⇒ Object
Creates the configuration file at
config/exekutor.yml
.
Instance Method Details
#create_configuration_file ⇒ Object
Creates the configuration file at config/exekutor.yml
. Uses the current worker configuration as the base.
13 14 15 16 17 18 19 20 21 |
# File 'lib/generators/exekutor/configuration_generator.rb', line 13 def create_configuration_file config = { queues: %w[queues to watch] }.merge(Exekutor.config.) config[:status_port] = 12_677 config[:set_db_connection_name] = true config[:wait_for_termination] = 120 filename = "config/exekutor#{".#{[:identifier]}" if [:identifier]}.yml" create_file filename, { "exekutor" => config.stringify_keys }.to_yaml end |