Sha256: 6801f799cc430d3982a3ff72985fea2d534c7e57fdd1d5b64390b058f2a6b10d

Contents?: true

Size: 1.62 KB

Versions: 2

Compression:

Stored size: 1.62 KB

Contents

# THIS FILE IS AUTO-GENERATED. PLEASE DO NOT CHANGE IT!

bundle = '<%= `which bundle`.strip %>'
rails_root = '<%= root %>'
God.pid_file_directory = '<%= pids %>'
God.terminate_timeout = <%= terminate_timeout.to_i %>

<% workers.each do |worker| %>
  <% worker.count.times do |i| %>
    God.watch do |w|
      w.dir = rails_root
      w.name = 'resque-<%= worker.queue %>-<%= i %>'
      w.group = 'resque'
      w.interval = 30.seconds
      w.env = <%= Resque::God.config.env.merge(worker.env).merge(:RAILS_ENV => ::Rails.env, :BUNDLE_GEMFILE => "#{root}/Gemfile").stringify_keys! %>
      w.start = "#{bundle} exec rake -f #{rails_root}/Rakefile resque:work"
      w.log = '<%= log_file %>'
      w.stop_signal = 'QUIT'

      <% if worker.stop_timeout %>
        w.stop_timeout = <%= worker.stop_timeout %>
      <% end %>

      # determine the state on startup
      w.transition(:init, { true => :up, false => :start }) do |on|
        on.condition(:process_running) do |c|
          c.running = true
        end
      end

      # determine when process has finished starting
      w.transition([:start, :restart], :up) do |on|
        on.condition(:process_running) do |c|
          c.running = true
          c.interval = 5.seconds
        end

        # failsafe
        on.condition(:tries) do |c|
          c.times = 5
          c.transition = :start
          c.interval = 5.seconds
        end
      end

      # start if process is not running
      w.transition(:up, :start) do |on|
        on.condition(:process_running) do |c|
          c.running = false
        end
      end
      # END OF WORKER CONFIGURATION
    end
  <% end %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
resque-god-0.0.2 lib/resque/god/god.erb
resque-god-0.0.1 lib/resque/god/god.erb