Created
July 16, 2011 22:56
-
-
Save andrerocker/1086891 to your computer and use it in GitHub Desktop.
vitae.me resque conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'resque/tasks' | |
require 'active_record' | |
env = ENV["RAILS_ENV"] || 'development' | |
database_config = YAML::load(File.open('config/database.yml')) | |
connection = ActiveRecord::Base.establish_connection(database_config[env]) | |
files = ['app/models/profile', 'app/workers/avatar'] | |
files.each { |file| require File.expand_path(file) } | |
namespace :resque do | |
namespace :vitae do | |
task :start do | |
fork do | |
ENV["QUEUE"] = "*" | |
Rake::Task["resque:work"].invoke | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment