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.
Note: The pid location is fixed at [current_path]/tmp/pids/delayed_job.pid“
Constant Summary
Constants inherited from Daemon
Sunshine::Daemon::RESTART_FAILED_CODE, Sunshine::Daemon::START_FAILED_CODE, Sunshine::Daemon::STATUS_DOWN_CODE, Sunshine::Daemon::STOP_FAILED_CODE
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, #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
#_restart_cmd, #_start_cmd, #_status_cmd, #_stop_cmd, binder_methods, #chown_log_files, #config_binding, #config_file_path, #config_template_files, #configure_remote_dirs, #each_server_app, #exit_on_failure, #has_setup?, #log_file, #log_files, #pick_sudo, #register_after_user_script, #restart, #setup, short_name, #start, #status, #stop, underscore, #upload_config_files
Constructor Details
#initialize(app, options = {}) ⇒ DelayedJob
Returns a new instance of DelayedJob.
12 13 14 15 16 17 18 19 20 |
# File 'lib/sunshine/daemons/delayed_job.rb', line 12 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
23 24 25 |
# File 'lib/sunshine/daemons/delayed_job.rb', line 23 def start_cmd "cd #{@app.current_path} && script/delayed_job -n #{@processes} start" end |
#stop_cmd ⇒ Object
28 29 30 |
# File 'lib/sunshine/daemons/delayed_job.rb', line 28 def stop_cmd "cd #{@app.current_path} && script/delayed_job stop" end |