Skip to content

Commit ccf1360

Browse files
committed
Don't start libjobqueue worker unless running under the Server
In particular, this avoids starting queue workers in the console which leads to ActiveJob emitting log messages into the console, which is confusing and distracting.
1 parent 951fdf5 commit ccf1360

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/litestack/litejobqueue.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def schedule(spawn = false, &block)
179179

180180
# create a worker according to environment
181181
def create_worker
182+
return if defined?(Rails) && !defined?(Rails::Server)
182183
Litescheduler.spawn do
183184
worker_sleep_index = 0
184185
while @running

0 commit comments

Comments
 (0)