项目作者: rohitjangid

项目描述 :
Remove scheduled jobs easily
高级语言: Ruby
项目地址: git://github.com/rohitjangid/sidekiq_remove_scheduled.git
创建时间: 2015-11-12T12:31:40Z
项目社区:https://github.com/rohitjangid/sidekiq_remove_scheduled

开源协议:

下载


SidekiqRemoveScheduled

Gem Version

This gem help to remove sidekiq scheduled jobs by maintaining all job ids. Just pass the arguments and this gem will take care of it.

Installation

Add this line to your application’s Gemfile:

  1. gem 'sidekiq_remove_scheduled'

Config this gem using following command

  1. SidekiqRemoveScheduled::Redis.config(host: 'localhost', port: '6379')

You can also add a logger.

SidekiqRemoveScheduled::Logger.set(Rails.logger) # You can pass any logger object

Then bind this gem with your sidekiq

  1. SidekiqRemoveScheduled.bind # Run this command after all configuration

Usage

For any worker

  1. class TestWorker
  2. include Sidekiq::Worker
  3. def perform(arg1, arg2)
  4. puts "#{agr1} #{arg2}"
  5. end
  6. end

If any job is enqueued as

  1. TestWorker.perform_in(5.minutes, "hello", "world")

Then dequeue this job using

  1. TestWorker.remove_scheduled("hello", "world")

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request