mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 14:26:36 +08:00
优化任务管理
This commit is contained in:
@@ -138,8 +138,8 @@ func RetryTask(ctx context.Context, id uint64) (string, error) {
|
||||
return "", fmt.Errorf(errTaskExecutionNotFound, err)
|
||||
}
|
||||
|
||||
if execution.Status != model.TaskExecutionStatusFailed {
|
||||
return "", fmt.Errorf(errRetryOnlyFailedTask, execution.Status)
|
||||
if execution.Status == model.TaskExecutionStatusPending || execution.Status == model.TaskExecutionStatusRunning {
|
||||
return "", fmt.Errorf(errRetryOnlyFinishedTask, execution.Status)
|
||||
}
|
||||
|
||||
if !execution.Retryable {
|
||||
@@ -299,6 +299,7 @@ func completeTaskExecution(ctx context.Context, execution *model.TaskExecution,
|
||||
span.RecordError(execErr)
|
||||
} else {
|
||||
execution.Status = model.TaskExecutionStatusSucceeded
|
||||
execution.ErrorMessage = "" // 清除历史重试失败遗留的错误信息
|
||||
if result != nil {
|
||||
execution.Result = result.Message
|
||||
if result.Detail != "" {
|
||||
|
||||
Reference in New Issue
Block a user