(e *core.RequestEvent)
| 35 | } |
| 36 | |
| 37 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…