Skip to content

Commit 9f3e36e

Browse files
Remove unnecessary logic from within for loop
1 parent a1bfec0 commit 9f3e36e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

internal/runners/mcp/projecterrors/projecterrors.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ func (runner *ProjectErrorsRunner) Run(params *Params) error {
109109
// If found, assume the issue is resolved so that a new build could be retried.
110110
func CheckDependencyFixes(auth *authentication.Auth, failedArtifacts []*buildplan.Artifact) (map[strfmt.UUID]bool, error) {
111111
fixed := make(map[strfmt.UUID]bool)
112+
latest, err := model.FetchLatestRevisionTimeStamp(auth)
113+
if err != nil {
114+
return nil, fmt.Errorf("Failed to fetch latest timestamp: %w", err)
115+
}
112116
for _, artifact := range failedArtifacts {
113-
latest, err := model.FetchLatestRevisionTimeStamp(auth)
114-
if err != nil {
115-
return nil, fmt.Errorf("Failed to fetch latest timestamp: %w", err)
116-
}
117117
// TODO: Query multiple artifacts at once to reduce API calls, improving performance.
118118
latestRevision, err := model.GetIngredientByNameAndVersion(
119119
artifact.Ingredients[0].Namespace, artifact.Name(), artifact.Version(), &latest, auth)

0 commit comments

Comments
 (0)