internal/infra/pg/subjectretention.go
internal/infra/pg · 45 lines · 1 declarations · source
Declarations
func expireUnusedSubjects
func expireUnusedSubjects(ctx context.Context, tx pgx.Tx, schema Schema, scope string, limit int, deleted map[string]int) error
Expired identity bookkeeping remains useful while any attributed source survives. Lock selected identities before a second existence check: a concurrent source insert holds KEY SHARE and its commit must be visible before cleanup decides the mapping is unused.