Skip to content

Instantly share code, notes, and snippets.

@andrerocker
Created July 16, 2011 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrerocker/1086891 to your computer and use it in GitHub Desktop.
Save andrerocker/1086891 to your computer and use it in GitHub Desktop.
vitae.me resque conf
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