Skip to content

Commit

Permalink
name change
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh committed Oct 22, 2024
1 parent 4281f97 commit 96498f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adapters/database/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ func (s *Service) GetActiveBuildersWithServiceCredentials(ctx context.Context) (

// LogEvent creates a new log entry in the event_log table.
// It uses hash and attestation_type to fetch the corresponding measurement_id via a subquery.
func (s *Service) LogEvent(ctx context.Context, eventName, builderName, hash, attestationType string) error {
func (s *Service) LogEvent(ctx context.Context, eventName, builderName, name, attestationType string) error {
// Insert new event log entry with a subquery to fetch the measurement_id
_, err := s.DB.ExecContext(ctx, `
INSERT INTO event_log
(event_name, builder_name, measurement_id)
VALUES ($1, $2,
(SELECT id FROM measurements_whitelist WHERE hash = $3 AND attestation_type = $4)
(SELECT id FROM measurements_whitelist WHERE name = $3 AND attestation_type = $4)
)
`, eventName, builderName, hash, attestationType)
`, eventName, builderName, name, attestationType)
if err != nil {
return fmt.Errorf("failed to insert event log for builder %s: %w", builderName, err)
}
Expand Down

0 comments on commit 96498f3

Please sign in to comment.