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

Method TaskStatus

driver/handle.go:74–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72}
73
74func (h *taskHandle) TaskStatus() (*drivers.TaskStatus, error) {
75 h.stateLock.RLock()
76 defer h.stateLock.RUnlock()
77
78 m := map[string]string{}
79
80 if h.runner != nil {
81 stat, err := h.runner.Stats()
82 if err != nil {
83 return nil, errors.Wrap(err, "runner.Stats")
84 }
85 m["GtidSet"] = stat.CurrentCoordinates.GtidSet
86 }
87
88 // TODO Cannot get InspectTask -> TaskStatus called by any API.
89 // See https://github.com/hashicorp/nomad/issues/4848
90 return &drivers.TaskStatus{
91 ID: h.taskConfig.ID,
92 Name: h.taskConfig.Name,
93 State: h.procState,
94 StartedAt: h.startedAt,
95 CompletedAt: h.completedAt,
96 ExitResult: h.exitResult,
97 DriverAttributes: m,
98 }, nil
99}
100
101// used when h.runner has not been setup
102func (h *taskHandle) onError(err error) {

Callers 1

InspectTaskMethod · 0.80

Calls 1

StatsMethod · 0.65

Tested by

no test coverage detected