Skip to content

Commit ddf8891

Browse files
authored
fix: set CustomTime when writing relations (#5033)
This was basically doubling the amount of work the workers had to do, since the record checker uses this field to see if the modified in GCS matches datastore 🤦 i.e. - A record gets ingested - The relations job computes new upstream/alias/related fields - It uploads the record with computed fields to GCS (but does not set the CustomTime field) - The record-checker runs. It compares the CustomTime field (empty) with the modified field in the Vulnerability datastore entity - Since they don't match, it sends a `gcs_mismatch` task to the recoverer - The recoverer picks up the `gcs_mismatch` task, and sends a reimport job to the worker - (since the alias/upstream/related have already been computed, this isn't an infinite loop)
1 parent 3d46c6e commit ddf8891

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

go/cmd/relations/update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ ConsumerLoop:
222222
}
223223
opts := &clients.WriteOptions{
224224
IfGenerationMatches: &attrs.Generation,
225+
CustomTime: &modified,
225226
}
226227
if err := u.gcsClient.WriteObject(ctx, path, newData, opts); err != nil {
227228
logger.Error("failed to write vuln to GCS", slog.String("id", id), slog.Any("err", err))

0 commit comments

Comments
 (0)