QueuePause 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 f
(ctx context.Context, name string, opts *QueuePauseOpts)
| 2678 | // used to cancel the operation or apply a timeout. The opts are reserved for |
| 2679 | // future functionality. |
| 2680 | func (c *Client[TTx]) QueuePause(ctx context.Context, name string, opts *QueuePauseOpts) error { |
| 2681 | tx, err := c.driver.GetExecutor().Begin(ctx) |
| 2682 | if err != nil { |
| 2683 | return err |
| 2684 | } |
| 2685 | defer dbutil.RollbackWithoutCancel(ctx, tx) |
| 2686 | |
| 2687 | if err := tx.QueuePause(ctx, &riverdriver.QueuePauseParams{ |
| 2688 | Name: name, |
| 2689 | Now: c.baseService.Time.NowOrNil(), |
| 2690 | Schema: c.config.Schema, |
| 2691 | }); err != nil { |
| 2692 | return err |
| 2693 | } |
| 2694 | |
| 2695 | controlEvent, err := c.notifyQueuePauseOrResume(ctx, tx, controlActionPause, name, opts) |
| 2696 | if err != nil { |
| 2697 | return err |
| 2698 | } |
| 2699 | |
| 2700 | if err = tx.Commit(ctx); err != nil { |
| 2701 | return err |
| 2702 | } |
| 2703 | |
| 2704 | c.notifyProducerWithoutListenerQueueControlEvent(name, controlEvent) |
| 2705 | |
| 2706 | return nil |
| 2707 | } |
| 2708 | |
| 2709 | // QueuePauseTx pauses the queue with the given name. When a queue is paused, |
| 2710 | // clients will not fetch any more jobs for that particular queue. To pause all |
nothing calls this directly
no test coverage detected