Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rohitjangid/sidekiq_remove_scheduled
Remove scheduled jobs easily
https://github.com/rohitjangid/sidekiq_remove_scheduled
ruby-gem ruby-on-rails sidekiq
Last synced: 27 days ago
JSON representation
Remove scheduled jobs easily
- Host: GitHub
- URL: https://github.com/rohitjangid/sidekiq_remove_scheduled
- Owner: rohitjangid
- Created: 2015-11-12T12:31:40.000Z (about 9 years ago)
- Default Branch: develop
- Last Pushed: 2020-04-28T05:43:15.000Z (over 4 years ago)
- Last Synced: 2024-12-08T00:23:42.736Z (about 1 month ago)
- Topics: ruby-gem, ruby-on-rails, sidekiq
- Language: Ruby
- Homepage: https://rubygems.org/gems/sidekiq_remove_scheduled
- Size: 15.6 KB
- Stars: 10
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SidekiqRemoveScheduled
[![Gem Version](https://badge.fury.io/rb/sidekiq_remove_scheduled.svg)](https://badge.fury.io/rb/sidekiq_remove_scheduled)
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:
gem 'sidekiq_remove_scheduled'
Config this gem using following command
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
SidekiqRemoveScheduled.bind # Run this command after all configuration
## Usage
For any worker
class TestWorker
include Sidekiq::Workerdef perform(arg1, arg2)
puts "#{agr1} #{arg2}"
end
endIf any job is enqueued as
TestWorker.perform_in(5.minutes, "hello", "world")
Then dequeue this job using
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