Skip to content

Commit

Permalink
Merge pull request #1319 from openmeterio/fix/subject-id-resolving-error
Browse files Browse the repository at this point in the history
fix: subject ID resolving error
  • Loading branch information
turip authored Aug 8, 2024
2 parents 2bd4286 + d45ea47 commit 626c54c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/entitlement/balanceworker/entitlementhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (w *Worker) createSnapshotEvent(ctx context.Context, entitlementID Namespac

subjectID := ""
if w.opts.SubjectIDResolver != nil {
subjectID, err = w.opts.SubjectIDResolver.GetSubjectIDByKey(ctx, entitlementID.Namespace, entitlementID.ID)
subjectID, err = w.opts.SubjectIDResolver.GetSubjectIDByKey(ctx, entitlementID.Namespace, entitlement.SubjectKey)
if err != nil {
return nil, fmt.Errorf("failed to get subject ID: %w", err)
}
Expand Down
2 changes: 2 additions & 0 deletions openmeter/entitlement/balanceworker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ type (
Worker = balanceworker.Worker
WorkerOptions = balanceworker.WorkerOptions
WorkerDLQOptions = balanceworker.WorkerDLQOptions

SubjectIDResolver = balanceworker.SubjectIDResolver
)

func New(opts WorkerOptions) (*Worker, error) {
Expand Down

0 comments on commit 626c54c

Please sign in to comment.