forked from nishidayuya/redmine_solid_queue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGemfile
More file actions
34 lines (29 loc) · 799 Bytes
/
Copy pathGemfile
File metadata and controls
34 lines (29 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
gem "solid_queue"
# set queue_adapter :solid_queue as default
module_name_method = Module.instance_method(:name)
trace = TracePoint.new(:end) do |tp|
next if module_name_method.bind_call(tp.self) != "RedmineApp::Application"
trace.disable
# respect administrator's setting
next if tp.self.config.active_job.queue_adapter
tp.self.config.active_job.queue_adapter = :solid_queue
end
trace.enable
if ENV["REDMINE_SOLID_QUEUE_DISABLE_PUMA_PLUGIN"] != "1"
# automatically enable :solid_queue Puma plugin
begin
require "puma"
require "puma/configuration"
Puma::Configuration.prepend(
Module.new do
def load
return super.tap do
@file_dsl.plugin(:solid_queue)
end
end
end
)
rescue LoadError
# nop
end
end