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)
| 155 | // new periodic job is fully enabled or disabled, it should be added or removed |
| 156 | // from _every_ active River client across all processes. |
| 157 | func (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. |