jam-cloud/web/lib/tasks/start.rake

39 lines
900 B
Ruby

# this rake file is meant to hold shortcuts/helpers for starting onerous command line executions
# bundle exec rake all_jobs
task :all_jobs do
Rake::Task['environment'].invoke
ENV['FORK_PER_JOB'] = 'false'
ENV['QUEUE'] = ENV['QUEUE'] || '*'
Rake::Task['resque:work'].invoke
end
# bundle exec rake audiomixer
task :audiomixer do
Rake::Task['environment'].invoke
ENV['FORK_PER_JOB'] = 'false'
ENV['QUEUE'] = 'audiomixer'
Rake::Task['resque:work'].invoke
end
# bundle exec rake icecast
task :icecast do
Rake::Task['environment'].invoke
ENV['FORK_PER_JOB'] = 'false'
ENV['QUEUE'] = 'icecast'
Rake::Task['resque:work'].invoke
end
# bundle exec rake odd_jobs
# this command is the same as used in production
task :odd_jobs do
Rake::Task['environment'].invoke
ENV['FORK_PER_JOB'] = 'false'
ENV['QUEUE'] = '*,!icecast,!audiomixer'
Rake::Task['resque:work'].invoke
end