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

Method AddMany

periodic_job.go:157–163  ·  view source on GitHub ↗

AddMany adds many new periodic jobs to the client. The jobs are queued immediately if their RunOnStart is enabled, and then scheduled normally. Returns a periodic job handle which can be used to subsequently remove the job if desired. Adding or removing periodic jobs has no effect unless this clie

(periodicJobs []*PeriodicJob)

Source from the content-addressed store, hash-verified

155// new periodic job is fully enabled or disabled, it should be added or removed
156// from _every_ active River client across all processes.
157func (b *PeriodicJobBundle) AddMany(periodicJobs []*PeriodicJob) []rivertype.PeriodicJobHandle {
158 handles, err := b.periodicJobEnqueuer.AddManySafely(sliceutil.Map(periodicJobs, b.mapper.toInternal))
159 if err != nil {
160 panic(err)
161 }
162 return handles
163}
164
165// AddManySafely is the same as AddMany, but it returns an error in the case of
166// a validation problem or duplicate ID instead of panicking.

Callers 3

Test_Client_MaintenanceFunction · 0.80
NewClientFunction · 0.80
TestPeriodicJobBundleFunction · 0.80

Calls 2

MapFunction · 0.92
AddManySafelyMethod · 0.45

Tested by 2

Test_Client_MaintenanceFunction · 0.64
TestPeriodicJobBundleFunction · 0.64