Sha256: dc127ecaebbfc243f218325896045e8424bd95646ae8e2913f62d576fbc13279

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

require 'resque'

unless Rails.env == 'test'
  logger = Logger.new(STDOUT)
  logger.formatter = proc do |severity, datetime, progname, msg|
    formatted_datetime = datetime.strftime("%Y-%m-%d %H:%M:%S.") << datetime.usec.to_s[0..2].rjust(3)
    "#{formatted_datetime} [#{severity}] #{msg} (pid:#{$$})\n"
  end
  Resque.logger = logger
  Resque.logger.level = Logger::INFO
  #Resque.logger.level = Logger::DEBUG

  attrs = {
    host: ENV['REDIS_HOST'] || 'localhost',
    port: ENV['REDIS_PORT'] || 6379,
    db: ENV['REDIS_DB'] || 0,
    password: ENV['REDIS_PASSWORD'] || nil
  }
  attrs.delete(:password) if attrs[:password].blank?
  Resque.redis = Redis.new(attrs)

  # If you want to be able to dynamically change the schedule,
  # uncomment this line.  A dynamic schedule can be updated via the
  # Resque::Scheduler.set_schedule (and remove_schedule) methods.
  # When dynamic is set to true, the scheduler process looks for
  # schedule changes and applies them on the fly.
  # Note: This feature is only available in >=2.0.0.
  # Resque::Scheduler.dynamic = true

  # The schedule doesn't need to be stored in a YAML, it just needs to
  # be a hash.  YAML is usually the easiest.
  # Resque.schedule = YAML.load_file('config/workers_schedule.yml')
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bigbluebutton_rails-3.0.0 spec/rails_app/config/initializers/resque.rb
bigbluebutton_rails-2.3.0 spec/rails_app/config/initializers/resque.rb