func (s *Service) handleTaskFail(ctx context.Context, task *resource.Task) {
	if task.FSM.Is(resource.TaskStateFailed) {
		return
	}

	if err := task.FSM.Event(resource.TaskEventDownloadFailed); err != nil {
		task.Log.Errorf("task fsm event failed: %v", err)
		return
	}
}
// Conditions for the task to switch to the TaskStateSucceeded are:
// 1. CDN downloads the resource falied
// 2. Dfdaemon back-to-source to download failed
Conditions for the task to switch to the TaskStateSucceeded are:
1. CDN downloads the resource falied
2. Dfdaemon back-to-source to download failed
// Conditions for the task to switch to the TaskStateSucceeded are : // 1 . CDN downloads the resource falied // 2 . Dfdaemon back - to - source to download failed
func (s *Service) handleTaskFail(ctx context.Context, task *resource.Task) {
	if task.FSM.Is(resource.TaskStateFailed) {
		return
	}
	if err := task.FSM.Event(resource.TaskEventDownloadFailed); err != nil {
		task.Log.Errorf("task fsm event failed: %v", err)
		return
	}
}
func ( s * Service ) handleTaskFail ( ctx context . Context , task * resource . Task ) { if task . FSM . Is ( resource . TaskStateFailed ) { return } if err := task . FSM . Event ( resource . TaskEventDownloadFailed ) ; err != nil { task . Log . Errorf ( " " , err ) return } }
Conditions for the task to switch to the TaskStateSucceeded are:
1.
Conditions for the task to switch to the TaskStateSucceeded are : 1 .