MCPcopy
hub / github.com/pocketbase/pocketbase / cronRun

Function cronRun

apis/cron.go:37–59  ·  view source on GitHub ↗
(e *core.RequestEvent)

Source from the content-addressed store, hash-verified

35}
36
37func cronRun(e *core.RequestEvent) error {
38 cronId := e.Request.PathValue("id")
39
40 var foundJob *cron.Job
41
42 jobs := e.App.Cron().Jobs()
43 for _, j := range jobs {
44 if j.Id() == cronId {
45 foundJob = j
46 break
47 }
48 }
49
50 if foundJob == nil {
51 return e.NotFoundError("Missing or invalid cron job", nil)
52 }
53
54 routine.FireAndForget(func() {
55 foundJob.Run()
56 })
57
58 return e.NoContent(http.StatusNoContent)
59}

Callers

nothing calls this directly

Calls 7

RunMethod · 0.95
FireAndForgetFunction · 0.92
JobsMethod · 0.80
NotFoundErrorMethod · 0.80
NoContentMethod · 0.80
CronMethod · 0.65
IdMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…