Skip to content

Commit a05f4ba

Browse files
excid3rosa
authored andcommitted
Copy over an example config on install
1 parent ae932ab commit a05f4ba

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/generators/solid_queue/install/install_generator.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22

33
class SolidQueue::InstallGenerator < Rails::Generators::Base
4+
source_root File.expand_path("templates", __dir__)
5+
46
class_option :skip_migrations, type: :boolean, default: nil, desc: "Skip migrations"
57

68
def add_solid_queue
@@ -9,6 +11,8 @@ def add_solid_queue
911
gsub_file env_config, /(# )?config\.active_job\.queue_adapter\s+=.*/, "config.active_job.queue_adapter = :solid_queue"
1012
end
1113
end
14+
15+
copy_file "config.yml", "config/solid_queue.yml"
1216
end
1317

1418
def create_migrations
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#default: &default
2+
# dispatchers:
3+
# - polling_interval: 1
4+
# batch_size: 500
5+
# workers:
6+
# - queues: "*"
7+
# threads: 5
8+
# processes: 1
9+
# polling_interval: 0.1
10+
#
11+
# development:
12+
# <<: *default
13+
#
14+
# test:
15+
# <<: *default
16+
#
17+
# production:
18+
# <<: *default

0 commit comments

Comments
 (0)