RunOnce do task only once no match Express or Interval no recover panic support for #6 新增RunOnce方法建议
()
| 84 | // no recover panic |
| 85 | // support for #6 新增RunOnce方法建议 |
| 86 | func (task *TaskInfo) RunOnce() error { |
| 87 | err := task.handler(task.getTaskContext()) |
| 88 | return err |
| 89 | } |
| 90 | |
| 91 | func (task *TaskInfo) getTaskContext() *TaskContext { |
| 92 | ctx := task.taskService.contextPool.Get().(*TaskContext) |
nothing calls this directly
no test coverage detected