Refactor error handling and improve code formatting in runners.go. Replace fmt.Errorf with errors.New for better error management. Clean up whitespace and enhance readability in various API response structures.
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@@ -1790,7 +1791,7 @@ func (s *Server) assignTaskToRunner(runnerID int64, taskID int64) error {
|
||||
types.TaskStatusPending, taskID,
|
||||
)
|
||||
s.logTaskEvent(taskID, nil, types.LogLevelError, errMsg, "")
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
|
||||
// Note: Task is already assigned in database by the atomic update in distributeTasksToRunners
|
||||
|
||||
Reference in New Issue
Block a user