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

Method DestroyTask

driver/driver.go:712–727  ·  view source on GitHub ↗
(taskID string, force bool)

Source from the content-addressed store, hash-verified

710}
711
712func (d *Driver) DestroyTask(taskID string, force bool) error {
713 d.logger.Info("DestroyTask", "id", taskID)
714 handle, ok := d.tasks.Get(taskID)
715 if !ok {
716 return drivers.ErrTaskNotFound
717 }
718 if handle.IsRunning() && !force {
719 return fmt.Errorf("cannot destroy running task")
720 }
721 handle.Destroy()
722
723 d.tasks.Delete(taskID)
724 AllocIdTaskNameToTaskHandler.Delete(taskID)
725
726 return nil
727}
728
729func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error) {
730 d.logger.Info("InspectTask", "taskID", taskID)

Callers

nothing calls this directly

Calls 4

GetMethod · 0.80
IsRunningMethod · 0.80
DestroyMethod · 0.80
DeleteMethod · 0.45

Tested by

no test coverage detected