Sha256: 03d9ff6cc17aee6c6ad6b6e6b9969914e6761dac6fec1ea4a4bcaa625603dd77
Contents?: true
Size: 956 Bytes
Versions: 5
Compression:
Stored size: 956 Bytes
Contents
# frozen_string_literal: true require 'rush' module Delayed module Workless module Scaler class Local < Base def self.executable_prefix if defined? Delayed::Compatibility.executable_prefix Delayed::Compatibility.executable_prefix else 'script' end end def self.up if workers == 0 Rush::Box.new[Rails.root].bash("#{executable_prefix}/delayed_job start -i workless", background: true) sleep 1 end true end def self.down if workers > 0 && jobs.count == 0 Rush::Box.new[Rails.root].bash("#{executable_prefix}/delayed_job stop -i workless", background: true) end true end def self.workers Rush::Box.new.processes.filter(cmdline: /delayed_job start -i workless|delayed_job.workless/).size end end end end end
Version data entries
5 entries across 5 versions & 2 rubygems