Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Aug 4, 2023
1 parent d0f4392 commit 53c2b82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 13 additions & 5 deletions resolver/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,19 @@ func startAsyncQuery(ctx context.Context, q *Query, currentRRCache *RRCache) {

// Set flag and log that we are refreshing this entry.
currentRRCache.RequestingNew = true
log.Tracer(ctx).Tracef(
"resolver: cache for %s will expire in %s, refreshing async now",
q.ID(),
time.Until(time.Unix(currentRRCache.Expires, 0)).Round(time.Second),
)
if currentRRCache.Expired() {
log.Tracer(ctx).Tracef(
"resolver: cache for %s has expired %s ago, refreshing async now",
q.ID(),
time.Since(time.Unix(currentRRCache.Expires, 0)).Round(time.Second),
)
} else {
log.Tracer(ctx).Tracef(
"resolver: cache for %s will expire in %s, refreshing async now",
q.ID(),
time.Until(time.Unix(currentRRCache.Expires, 0)).Round(time.Second),
)
}

// resolve async
module.StartWorker("resolve async", func(asyncCtx context.Context) error {
Expand Down
4 changes: 2 additions & 2 deletions updates/os_integration_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ func upgradeSystemIntegrationFileContents(
}

// Check if we are allowed to upgrade from the existing file.
if !slices.Contains[string](permittedUpgradeHashes, existingHexSum) {
return fmt.Errorf("%s at %s %w, as it is not a previously published version and cannot be automatically upgraded - try installing again", name, filePath, ErrRequiresManualUpgrade)
if !slices.Contains[[]string, string](permittedUpgradeHashes, existingHexSum) {

Check failure on line 133 in updates/os_integration_linux.go

View workflow job for this annotation

GitHub Actions / Test

got 2 type arguments but want 1

Check failure on line 133 in updates/os_integration_linux.go

View workflow job for this annotation

GitHub Actions / Test

got 2 type arguments but want 1
return fmt.Errorf("%s at %s (sha256:%s) %w, as it is not a previously published version and cannot be automatically upgraded - try installing again", name, filePath, existingHexSum, ErrRequiresManualUpgrade)
}

// Start with upgrade!
Expand Down

0 comments on commit 53c2b82

Please sign in to comment.