Sha256: 81497fd290275f91ea70e9bf16a508b3e5cf62ba12d68e550218e477a94140c4

Contents?: true

Size: 651 Bytes

Versions: 11

Compression:

Stored size: 651 Bytes

Contents

cwd = File.expand_path(File.join(File.dirname(__FILE__), %w[../ ../]))

config_path = File.join(cwd, %w[config dj.yml])

workers_count = if File.exist?(config_path)
  YAML.load_file(config_path).try(:[], :workers) || 5
else
  5
end

Eye.application 'delayed_job' do
  working_dir cwd
  stop_on_delete true

  group 'dj' do
    chain grace: 5.seconds

    (1..workers_count).each do |i|
      process "dj-#{i}" do
        pid_file "tmp/pids/delayed_job.#{i}.pid"
        start_command 'rake jobs:work'
        daemonize true
        stop_signals [:INT, 30.seconds, :TERM, 10.seconds, :KILL]
        stdall "log/dj-#{i}.log"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
eye-0.10.1.pre examples/delayed_job.eye
eye-0.10.0 examples/delayed_job.eye
eye-0.10.0.alpha2 examples/delayed_job.eye
eye-0.10.0.alpha examples/delayed_job.eye
eye-0.9.4.nosigar examples/delayed_job.eye
eye-0.9.4 examples/delayed_job.eye
eye-0.9.3 examples/delayed_job.eye
eye-0.9.2.nosigar examples/delayed_job.eye
eye-0.9.2 examples/delayed_job.eye
eye-0.9.1 examples/delayed_job.eye
eye-0.9.pre examples/delayed_job.eye