Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Meredith Lancaster <[email protected]>
  • Loading branch information
malancas committed Jun 14, 2024
1 parent c573163 commit 8db5b66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/tuf/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ var (
// GetTrustedRoot returns the trusted root for the TUF repository.
func GetTrustedRoot() (*root.TrustedRoot, error) {
now := time.Now().UTC()
if timestamp.IsZero() || timestamp.Before(now.Add(-24*time.Hour)) {
// check if timestamp has never been or if the current time is more
// than 24 hours after the current value of timestamp
if timestamp.IsZero() || now.After(timestamp.Add(24*time.Hour)) {
mu.Lock()
defer mu.Unlock()

Expand Down

0 comments on commit 8db5b66

Please sign in to comment.