QueuePauseTx pauses the queue with the given name. When a queue is paused, clients will not fetch any more jobs for that particular queue. To pause all queues at once, use the special queue name "*". Clients with a configured notifier should receive a notification about the paused queue(s) within a
(ctx context.Context, tx TTx, name string, opts *QueuePauseOpts)
| 2718 | // used to cancel the operation or apply a timeout. The opts are reserved for |
| 2719 | // future functionality. |
| 2720 | func (c *Client[TTx]) QueuePauseTx(ctx context.Context, tx TTx, name string, opts *QueuePauseOpts) error { |
| 2721 | executorTx := c.driver.UnwrapExecutor(tx) |
| 2722 | |
| 2723 | if err := executorTx.QueuePause(ctx, &riverdriver.QueuePauseParams{ |
| 2724 | Name: name, |
| 2725 | Now: c.baseService.Time.NowOrNil(), |
| 2726 | Schema: c.config.Schema, |
| 2727 | }); err != nil { |
| 2728 | return err |
| 2729 | } |
| 2730 | |
| 2731 | if _, err := c.notifyQueuePauseOrResume(ctx, executorTx, controlActionPause, name, opts); err != nil { |
| 2732 | return err |
| 2733 | } |
| 2734 | |
| 2735 | return nil |
| 2736 | } |
| 2737 | |
| 2738 | // QueueResume resumes the queue with the given name. If the queue was |
| 2739 | // previously paused, any clients configured to work that queue will resume |