File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -16,5 +16,7 @@ def authenticate_admin
16
16
17
17
Rails . application . configure do
18
18
# The create_students_job queue is a serial queue that allows only one job at a time.
19
+ # DO NOT change the the value of create_students_job:1 without understanding the implications
20
+ # of processing more than one user creation job at once.:
19
21
config . good_job . queues = 'create_students_job:1;default:5'
20
22
end
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails_helper'
4
+
5
+ RSpec . describe Rails do
6
+ it 'ensures the create_students_job queue only has one worker' do
7
+ queues_config = described_class . application . config . good_job . queues
8
+ # queues_config is a string like "create_students_job:1;default:5"
9
+
10
+ # Parse the queues into a hash
11
+ parsed_queues = queues_config . split ( ';' ) . to_h do |q |
12
+ name , concurrency = q . split ( ':' )
13
+ [ name , concurrency . to_i ]
14
+ end
15
+
16
+ expect ( parsed_queues [ 'create_students_job' ] ) . to eq ( 1 )
17
+ end
18
+ end
You can’t perform that action at this time.
0 commit comments