MCPcopy
hub / github.com/pocketbase/pocketbase / process

Method process

apis/batch.go:235–273  ·  view source on GitHub ↗
(activeApp core.App, batch []*core.InternalRequest, i int)

Source from the content-addressed store, hash-verified

233}
234
235func (p *batchProcessor) process(activeApp core.App, batch []*core.InternalRequest, i int) error {
236 select {
237 case <-p.stopCh:
238 return nil
239 default:
240 if len(batch) == 0 {
241 return nil
242 }
243
244 result, err := processInternalRequest(
245 activeApp,
246 p.baseEvent,
247 batch[0],
248 p.infoContext,
249 func(_ any) error {
250 if len(batch) == 1 {
251 return nil
252 }
253
254 err := p.process(activeApp, batch[1:], i+1)
255
256 // update the failed batch index (if not already)
257 if err != nil && p.failedIndex == 0 {
258 p.failedIndex = i + 1
259 }
260
261 return err
262 },
263 )
264
265 if err != nil {
266 return err
267 }
268
269 p.results = append(p.results, result)
270
271 return nil
272 }
273}
274
275func processInternalRequest(
276 activeApp core.App,

Callers 1

ProcessMethod · 0.95

Calls 1

processInternalRequestFunction · 0.85

Tested by

no test coverage detected