Sha256: 6ea09855f47b320ac155fc3159b41b6be942bb765a201d94c9b64fa9a44a67af

Contents?: true

Size: 770 Bytes

Versions: 7

Compression:

Stored size: 770 Bytes

Contents

# vim:fileencoding=utf-8

require 'json'
require 'yaml'
require 'resque'

redis_env_var = ENV['REDIS_PROVIDER'] || 'REDIS_URL'
Resque.redis = ENV[redis_env_var] || 'localhost:6379'

require 'resque_scheduler'
require 'resque_scheduler/server'

schedule_yml = ENV['RESQUE_SCHEDULE_YML']
if schedule_yml
  if File.exist?(schedule_yml)
    Resque.schedule = YAML.load_file(schedule_yml)
  else
    Resque.schedule = YAML.load(schedule_yml)
  end
end

schedule_json = ENV['RESQUE_SCHEDULE_JSON']
if schedule_json
  if File.exist?(schedule_json)
    Resque.schedule = JSON.parse(File.read(schedule_json))
  else
    Resque.schedule = JSON.parse(schedule_json)
  end
end

class Putter
  @queue = 'putting'

  def self.perform(*args)
    args.each { |arg| puts arg }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
resque-scheduler-2.5.5 examples/config/initializers/resque-web.rb
resque-scheduler-2.5.4 examples/config/initializers/resque-web.rb
resque-scheduler-2.5.3 examples/config/initializers/resque-web.rb
resque-scheduler-2.5.2 examples/config/initializers/resque-web.rb
resque-scheduler-2.5.1 examples/config/initializers/resque-web.rb
resque-scheduler-2.5.0 examples/config/initializers/resque-web.rb
resque-scheduler-2.4.0 examples/config/initializers/resque-web.rb