Skip to content

Commit 6d47f0c

Browse files
authored
add comment on certifier when last-scan is set or not set (#2167)
Signed-off-by: pxp928 <[email protected]>
1 parent e5b1595 commit 6d47f0c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/certifier/components/root_package/root_package.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/Khan/genqlient/graphql"
2424
"github.com/guacsec/guac/pkg/assembler/clients/generated"
2525
"github.com/guacsec/guac/pkg/certifier"
26+
"github.com/guacsec/guac/pkg/logging"
2627
)
2728

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

70+
// logger
71+
logger := logging.FromContext(ctx)
72+
if p.lastScan != nil {
73+
lastScanTime := time.Now().Add(time.Duration(-*p.lastScan) * time.Hour).UTC()
74+
logger.Infof("last-scan set to: %d hours, last scan time set to: %v", *p.lastScan, lastScanTime)
75+
} else {
76+
logger.Infof("last-scan not set, running on full package list")
77+
}
78+
6979
tickInterval := 5 * time.Second
7080

7181
// nodeChan to receive components

0 commit comments

Comments
 (0)