Skip to content

Commit 16a5eac

Browse files
committed
chore(backend): add missing sentry capture
1 parent ee2d747 commit 16a5eac

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

internal/db/artifacts.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,19 @@ func CreateArtifactPullLogEntry(
630630
if remoteAddress == "" {
631631
remoteAddressPtr = nil
632632
}
633+
634+
args := pgx.NamedArgs{
635+
"versionId": versionID,
636+
"remoteAddress": remoteAddressPtr,
637+
"customerOrgId": customerOrgID,
638+
}
639+
640+
if userID != uuid.Nil {
641+
args["userId"] = userID
642+
} else {
643+
args["userId"] = nil
644+
}
645+
633646
_, err := db.Exec(
634647
ctx,
635648
`INSERT INTO ArtifactVersionPull (
@@ -644,12 +657,7 @@ func CreateArtifactPullLogEntry(
644657
@remoteAddress,
645658
@customerOrgId
646659
)`,
647-
pgx.NamedArgs{
648-
"versionId": versionID,
649-
"userId": userID,
650-
"remoteAddress": remoteAddressPtr,
651-
"customerOrgId": customerOrgID,
652-
},
660+
args,
653661
)
654662
if err != nil {
655663
return fmt.Errorf("could not create artifact pull log entry: %w", err)

0 commit comments

Comments
 (0)