MCPcopy Index your code
hub / github.com/bytebase/bytebase / RunExecutorOnce

Function RunExecutorOnce

backend/runner/taskrun/executor.go:24–38  ·  view source on GitHub ↗

RunExecutorOnce wraps a TaskExecutor.RunOnce call with panic recovery.

(ctx context.Context, driverCtx context.Context, exec Executor, task *store.TaskMessage, taskRunUID int64)

Source from the content-addressed store, hash-verified

22
23// RunExecutorOnce wraps a TaskExecutor.RunOnce call with panic recovery.
24func RunExecutorOnce(ctx context.Context, driverCtx context.Context, exec Executor, task *store.TaskMessage, taskRunUID int64) (result *storepb.TaskRunResult, err error) {
25 defer func() {
26 if r := recover(); r != nil {
27 panicErr, ok := r.(error)
28 if !ok {
29 panicErr = errors.Errorf("%v", r)
30 }
31 slog.ErrorContext(ctx, "TaskExecutor PANIC RECOVER", log.BBError(panicErr), log.BBStack("panic-stack"))
32 result = nil
33 err = errors.Errorf("TaskExecutor PANIC RECOVER, err: %v", panicErr)
34 }
35 }()
36
37 return exec.RunOnce(ctx, driverCtx, task, taskRunUID)
38}

Callers 1

runTaskRunOnceMethod · 0.85

Calls 4

BBErrorFunction · 0.92
BBStackFunction · 0.92
ErrorfMethod · 0.80
RunOnceMethod · 0.65

Tested by

no test coverage detected