MCPcopy Create free account
hub / github.com/actiontech/dtle / newDtleTaskHandle

Function newDtleTaskHandle

driver/handle.go:47–61  ·  view source on GitHub ↗
(ctx context.Context, logger g.LoggerType, cfg *drivers.TaskConfig, state drivers.TaskState, started time.Time)

Source from the content-addressed store, hash-verified

45}
46
47func newDtleTaskHandle(ctx context.Context, logger g.LoggerType, cfg *drivers.TaskConfig, state drivers.TaskState, started time.Time) *taskHandle {
48 h := &taskHandle{
49 logger: logger,
50 stateLock: sync.RWMutex{},
51 taskConfig: cfg,
52 procState: state,
53 startedAt: started,
54 completedAt: time.Time{},
55 exitResult: nil,
56 waitCh: make(chan *drivers.ExitResult),
57 }
58 h.ctx, h.cancelFunc = context.WithCancel(ctx)
59 go h.watchWaitCh()
60 return h
61}
62
63func (h *taskHandle) watchWaitCh() {
64 select {

Callers 1

StartTaskMethod · 0.85

Calls 1

watchWaitChMethod · 0.95

Tested by

no test coverage detected