feat: reconcile Agones allocations durably

This commit is contained in:
Josh Creek
2026-09-01 09:51:52 +01:00
parent 931e51a647
commit 0023bdab6e
6 changed files with 168 additions and 3 deletions
+4
View File
@@ -137,6 +137,10 @@ type queueTicketRecord struct {
type PostgresQueue struct{ DB *sql.DB }
func (q PostgresQueue) RecordProviderAllocation(ctx context.Context, allocation domain.Allocation, now time.Time) (domain.Allocation, error) {
return RecordProviderAllocation(ctx, q.DB, allocation, now)
}
const QueueProbeRecordSQL = `UPDATE queue_tickets
SET predicted_rtt = jsonb_set(COALESCE(predicted_rtt, '{}'::jsonb), ARRAY[$2], to_jsonb($3::double precision), true)
WHERE player_id = $1 AND state IN ('QUEUED', 'PROPOSED') AND expires_at > $4`