Sha256: 822d9e2d52fe15776e1b6a6f8398e938a3092d3db497e8291bc8dc2ad9db678c
Contents?: true
Size: 1.42 KB
Versions: 24
Compression:
Stored size: 1.42 KB
Contents
######### ## Adds support to monitor delayed_job processes through eye ######### def delayed_job_args args = [] args << "--queues=#{fetch(:delayed_job_queues).join(',')}" unless fetch(:delayed_job_queues).nil? args << "--prefix=#{fetch(:delayed_job_prefix)}" unless fetch(:delayed_job_prefix).nil? args << fetch(:delayed_job_pools, {}).map {|k,v| "--pool=#{k}:#{v}"}.join(' ') unless fetch(:delayed_job_pools).nil? args.join(' ') end def delayed_job_bin "#{fetch(:delayed_job_bin_path)}/delayed_job" end def delayed_job_start_command "#{fetch(:rbenv_prefix)} bundle exec #{delayed_job_bin} #{delayed_job_args} -i \#{i} start" end def delayed_job_stop_command "#{fetch(:rbenv_prefix)} bundle exec #{delayed_job_bin} -i \#{i} stop" end # Watch the delayed_job processes using the build in template namespace :eye do task :watch_process do watch_process(:delayed_job, { start_command: delayed_job_start_command, stop_command: delayed_job_stop_command }) end end # Override start, restart and stop delayed_job tasks to so they call # the eye equivalents namespace :delayed_job do ['start','restart','stop'].each do |cmd| if Rake::Task.task_defined?("delayed_job:#{cmd}") Rake::Task["delayed_job:#{cmd}"].clear_actions # Reload or restart delayed_job after the application is published desc "using eye" task cmd do invoke "eye:#{cmd}", 'delayed-job' end end end end
Version data entries
24 entries across 24 versions & 1 rubygems