Skip to content

Commit

Permalink
date-issue-fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
an1l4 committed Mar 4, 2024
1 parent 9a50b47 commit 4de4ab7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client/pkg/clickhouse/db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,18 @@ func (c *DBClient) InsertTrivySbomMetrics(metrics model.Sbom) {
log.Println("error: component not found or not in expected format")
return
}
timestamp, _ := metadata["timestamp"].(time.Time)
//timestamp, _ := metadata["timestamp"].(time.Time)
var timestamp time.Time
rawTimestamp, ok := metadata["timestamp"].(string)
if !ok {
log.Println("error: timestamp not found or not in expected format")
return
}
timestamp, err = time.Parse(time.RFC3339, rawTimestamp)
if err != nil {
log.Println("error parsing timestamp:", err)
return
}

// inside metadata
// taking component
Expand Down

0 comments on commit 4de4ab7

Please sign in to comment.