Class: Sunshine::DelayedJob
- Defined in:
- lib/sunshine/daemons/delayed_job.rb
Overview
Simple daemon wrapper for delayed_job daemon setup and control. By default, uses server apps with the :dj role. Supports the :processes option.
Instance Attribute Summary
Attributes inherited from Daemon
#app, #bin, #config_file, #config_path, #config_template, #name, #pid, #processes, #restart_cmd, #server_apps, #status_cmd, #sudo, #target, #timeout
Instance Method Summary collapse
-
#initialize(app, options = {}) ⇒ DelayedJob
constructor
A new instance of DelayedJob.
- #start_cmd ⇒ Object
- #stop_cmd ⇒ Object
Methods inherited from Daemon
binder_methods, #config_file_path, #config_template_files, #each_server_app, #has_setup?, #log_file, #log_files, #restart, #setup, #start, #stop, underscore, #upload_config_files
Constructor Details
#initialize(app, options = {}) ⇒ DelayedJob
Returns a new instance of DelayedJob.
10 11 12 13 14 15 16 17 18 |
# File 'lib/sunshine/daemons/delayed_job.rb', line 10 def initialize app, ={} [:role] ||= :dj super app, @pid = "#{@app.current_path}/tmp/pids/delayed_job.pid" @dep_name = [:dep_name] || "daemons" end |
Instance Method Details
#start_cmd ⇒ Object
21 22 23 |
# File 'lib/sunshine/daemons/delayed_job.rb', line 21 def start_cmd "cd #{@app.current_path} && script/delayed_job -n #{@processes} start" end |
#stop_cmd ⇒ Object
26 27 28 |
# File 'lib/sunshine/daemons/delayed_job.rb', line 26 def stop_cmd "cd #{@app.current_path} && script/delayed_job stop" end |