Skip to content

Commit

Permalink
fix: check the files regardless of the definition cache
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Nov 15, 2023
1 parent 23d2f67 commit 9f833b4
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions internal/fingerprint/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,6 @@ func IsTaskUpToDate(
return false, err
}

// if the status or sources are set, check if the definition is up-to-date
// TODO: allow caching based on the task definition even if status or sources are not set
if sourcesIsSet || statusIsSet {
// check if the definition is up-to-date
isDefinitionUpToDate, err := config.definitionChecker.IsUpToDate(maybeDefinitionPath)
if err != nil {
return false, err
}
// defintion is not up-to-date, early return
if !isDefinitionUpToDate {
return false, nil
}
}

// If status is set, check if it is up-to-date
if statusIsSet {
statusUpToDate, err = config.statusChecker.IsUpToDate(ctx, t)
Expand Down Expand Up @@ -161,5 +147,16 @@ func IsTaskUpToDate(
}
}

// if the status or sources are set, check if the definition is up-to-date
// TODO: allow caching based on the task definition even if status or sources are not set
if sourcesIsSet || statusIsSet {
// check if the definition is up-to-date
isDefinitionUpToDate, err := config.definitionChecker.IsUpToDate(maybeDefinitionPath)
if err != nil {
return false, err
}
isUpToDate = isUpToDate && isDefinitionUpToDate
}

return isUpToDate, nil
}

0 comments on commit 9f833b4

Please sign in to comment.