Skip to content

Commit e911f4a

Browse files
committed
readme update
1 parent 3823230 commit e911f4a

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ default `'text'`)
146146
`MonoLogger::FATAL`, default `false`)
147147
* `VERBOSE` - Maximize log verbosity if non-empty (equivalent to a level
148148
of `MonoLogger::DEBUG`, default `false`)
149-
149+
* `ENABLE_DELAYED_REQUEUE_BATCH` - Enable batched delayed job enqueueing per second (default `false`) - [See section below on consequences](#batched-delayed-job-and-resque-enqueue-hooks)
150+
* `DELAYED_REQUEUE_BATCH_SIZE` - Set the delayed job batch size if `ENABLE_DELAYED_REQUEUE_BATCH` is enabled (default `100`). If `<= 1`, this disables batching.
150151

151152
### Resque Pool integration
152153

@@ -755,6 +756,21 @@ This table explains the version requirements for rufus-scheduler
755756
| `~> 4.0` | `~> 3.0` |
756757
| `< 4.0` | `~> 2.0` |
757758

759+
##### Batched delayed job and resque enqueue hooks
760+
761+
Batching delayed job enqueueing can speed up when per-second job counts grows,
762+
avoiding situations that may cause delayed enqueues to fall behind. This batching wraps enqueues in a `multi` pipeline, making far fewer roundtrips to the server.
763+
764+
However, in `redis` gem `>= 4.0`, any operations to redis within the `multi`
765+
block must use the multi handle so that the actions are captured. Resque's hooks
766+
do not currently have a way to pass this around, and so compatibility with other
767+
resque plugins or hooks which access redis at enqueue time is impacted with
768+
batch mode.
769+
770+
Detecting when this occurs can be tricky, you must watch for logs
771+
emitted by your `resque-scheduler` process such as `Redis::CommandError: ERR
772+
MULTI calls can not be nested` or `NoMethodError: undefined method nil? for
773+
<Redis::Future`, and delayed jobs you expect would not be enqueued.
758774

759775
### Contributing
760776

0 commit comments

Comments
 (0)