Skip to content

Commit

Permalink
add comment on certifier when last-scan is set or not set (#2167)
Browse files Browse the repository at this point in the history
Signed-off-by: pxp928 <[email protected]>
  • Loading branch information
pxp928 authored Oct 4, 2024
1 parent e5b1595 commit 6d47f0c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/certifier/components/root_package/root_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/Khan/genqlient/graphql"
"github.com/guacsec/guac/pkg/assembler/clients/generated"
"github.com/guacsec/guac/pkg/certifier"
"github.com/guacsec/guac/pkg/logging"
)

const guacType string = "guac"
Expand Down Expand Up @@ -66,6 +67,15 @@ func (p *packageQuery) GetComponents(ctx context.Context, compChan chan<- interf
return fmt.Errorf("compChan cannot be nil")
}

// logger
logger := logging.FromContext(ctx)
if p.lastScan != nil {
lastScanTime := time.Now().Add(time.Duration(-*p.lastScan) * time.Hour).UTC()
logger.Infof("last-scan set to: %d hours, last scan time set to: %v", *p.lastScan, lastScanTime)
} else {
logger.Infof("last-scan not set, running on full package list")
}

tickInterval := 5 * time.Second

// nodeChan to receive components
Expand Down

0 comments on commit 6d47f0c

Please sign in to comment.