Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sensorsasha committed Apr 20, 2023
1 parent 5ec29ab commit 0ca26f6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,21 @@ Sidekiq::Ultimate::Resurrector::Count.read(:job_id => "2647c4fe13acc692326bd4c2"
=> 1
```

### Empty queues list refresh interval

```ruby
Sidekiq::Ultimate.setup! do |config|
config.empty_queues_refresh_interval = 42
end
```

It specifies how often the list of empty queues should be refreshed.
In a nutshell, it specifies the maximum possible delay between a job was pushed to previously empty queue and
the moment when that new job is picked up.

**Note** that every worker needs to maintain its own local list of empty queues. Setting this interval to a low
values will increase the number of redis calls and will increase the load on redis.

---

**NOTICE**
Expand Down
7 changes: 7 additions & 0 deletions lib/sidekiq/ultimate/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ class Configuration
# resurrection counter can be enabled to count how many times a job was resurrected.
# If `enable_resurrection_counter` setting is enabled, on each resurrection event, a counter is increased.
# Counter value is stored in redis by jid and has expiration time 24 hours.
# @return [Boolean]
attr_accessor :enable_resurrection_counter

# It specifies how often the list of empty queues should be refreshed.
# In a nutshell, it specifies the maximum possible delay between a job was pushed to previously empty queue and
# the moment when that new job is picked up.
# Note that every worker needs to maintain its own local list of empty queues. Setting this interval to a low
# values will increase the number of redis calls and will increase the load on redis.
# @return [Integer] interval in seconds to refresh the list of empty queues
attr_reader :empty_queues_refresh_interval

DEFAULT_EMPTY_QUEUES_REFRESH_INTERVAL = 30
Expand Down

0 comments on commit 0ca26f6

Please sign in to comment.