MCPcopy Index your code
hub / github.com/riverqueue/river / NewQueueCleaner

Function NewQueueCleaner

internal/maintenance/queue_cleaner.go:87–100  ·  view source on GitHub ↗
(archetype *baseservice.Archetype, config *QueueCleanerConfig, exec riverdriver.Executor)

Source from the content-addressed store, hash-verified

85}
86
87func NewQueueCleaner(archetype *baseservice.Archetype, config *QueueCleanerConfig, exec riverdriver.Executor) *QueueCleaner {
88 batchSizes := config.WithDefaults()
89
90 return baseservice.Init(archetype, &QueueCleaner{
91 Config: (&QueueCleanerConfig{
92 BatchSizes: batchSizes,
93 Interval: cmp.Or(config.Interval, queueCleanerIntervalDefault),
94 RetentionPeriod: cmp.Or(config.RetentionPeriod, QueueRetentionPeriodDefault),
95 Schema: config.Schema,
96 }).mustValidate(),
97 exec: exec,
98 reducedBatchSizeBreaker: riversharedmaintenance.ReducedBatchSizeBreaker(batchSizes),
99 })
100}
101
102func (s *QueueCleaner) Start(ctx context.Context) error {
103 ctx, shouldStart, started, stopped := s.StartInit(ctx)

Callers 3

NewClientFunction · 0.92
TestQueueMaintainerFunction · 0.85
TestQueueCleanerFunction · 0.85

Calls 4

InitFunction · 0.92
ReducedBatchSizeBreakerFunction · 0.92
WithDefaultsMethod · 0.45
mustValidateMethod · 0.45

Tested by 2

TestQueueMaintainerFunction · 0.68
TestQueueCleanerFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…