
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
This is an extension for Sidekiq that by default doesn't allow a job to be enqueued if it's already in the queue or being processed.
It does so by keeping in Redis the information about each job's status, where a job is identified by its class and arguments. Possible statuses are: enqueued, running and completed. In case a job fails and is unable to release the lock, all status keys expire (by using Redis' EXPIRE
command) after some time (which can be defined by Sidekiq::Uniq::Status.expiration = <time in seconds>
).
Useful to use with recurring jobs, like the ones created by sidekiq-cron.
When such thing is not used, if you have tons of jobs to be processed, and the time to process the queue is greater than the interval of the jobs, you can end up with a huge queue on Redis, leading to memory usage problems (protip).
Add this line to your application's Gemfile:
gem 'sidekiq-uniq'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sidekiq-uniq
If you want the default behavior (which is to not allow a job to be enqueued if it's already in the queue), nothing is needed.
If you want to avoid the default behavior for a given job, just add sidekiq_options unique: false
to it.
Expiration time can be defined like this: Sidekiq::Uniq::Status.expiration = <time in seconds>
. The dafault value is 30 minutes.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that sidekiq-uniq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.