Skip to content

Commit 5aa05ae

Browse files
flavorjonesrosa
authored andcommitted
Wrap Supervisor#start and stop with the app executor
to support applications that are using Executor callbacks or setting a custom app executor.
1 parent 5c4f452 commit 5aa05ae

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lib/solid_queue/supervisor.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,22 @@ def initialize(configuration)
2929
end
3030

3131
def start
32-
boot
33-
run_start_hooks
32+
wrap_in_app_executor do
33+
boot
34+
run_start_hooks
3435

35-
start_processes
36-
launch_maintenance_task
36+
start_processes
37+
launch_maintenance_task
3738

38-
supervise
39+
supervise
40+
end
3941
end
4042

4143
def stop
42-
super
43-
run_stop_hooks
44+
wrap_in_app_executor do
45+
super
46+
run_stop_hooks
47+
end
4448
end
4549

4650
private

0 commit comments

Comments
 (0)