Как запустить resque:scheduler под Windows?

Windows 8. Пытаюсь прикрутить к сайту планировщик задач.

Gemfile
gem 'resque', :require => 'resque/server'
gem 'resque_mailer'
gem 'resque-scheduler'


lib/tasks/resque.rake
require 'resque/tasks' 
require 'resque/scheduler/tasks'
task "resque:setup" => :environment

namespace :resque do
  task :setup do
    require 'resque'

    # you probably already have this somewhere
    # Resque.redis = 'localhost:6379'
  end

  task :setup_schedule => :setup do
    require 'resque-scheduler'

    # 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("#{Rails.root}/config/rescue_schedule.yml")

    # If your schedule already has +queue+ set for each job, you don't
    # need to require your jobs.  This can be an advantage since it's
    # less code that resque-scheduler needs to know about. But in a small
    # project, it's usually easier to just include you job classes here.
    # So, something like this:
    # require 'jobs'
  end

  task :scheduler_setup => :setup_schedule
end

config/resque_schedule.yml
send_sms_ru_balance:
  cron: "30 6 * * 1"
  class: "SendSmsRuBalance"
  every:
    - '1h'
    - :first_in: '10s' 
  queue: low
  description: "Отправка баланса sms.ru на почту"

app/workers/send_sms_ru_balance.rb
class SendSmsRuBalance
	@queue = :send_sms_balance
	def self.perform
		AdminMailer.send_sms_balance.deliver_now
	end
end


Запускаю планировщик:
rake resque:scheduler
Выдает ошибку
unsupported signal SIGUSR1

Что делаю не так?
  • Вопрос задан
  • 287 просмотров
Решения вопроса 1
@sunnmas Автор вопроса
Ruby
с поставленными задачами справился гем clockwork/ Он замечательно работает с resque. и запускается под windows
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
viktorvsk
@viktorvsk
Что делаю не так?

Используете виндовс.

Тут или вагрант, или стойко переносить все тягости и лишения.
Вот, например, почитайте аналогичную тему:
https://github.com/mperham/sidekiq/issues/205
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы