feat: add assignment readiness gate

This commit is contained in:
Josh Creek
2026-08-31 20:45:29 +01:00
parent 2b8bce5e4b
commit 81e68bb5fa
4 changed files with 109 additions and 2 deletions
+5 -1
View File
@@ -37,6 +37,10 @@ type Allocation struct {
AllocationID string
MatchID string
ServerID string
Region string
Build string
Protocol int
Transport string
State ServerLifecycle
AllocatedAt time.Time
}
@@ -96,7 +100,7 @@ func (a *Allocator) Allocate(request AllocationRequest, now time.Time) (Allocati
server := a.servers[ids[0]]
server.State = ServerAllocated
a.servers[server.ServerID] = server
allocation := Allocation{AllocationID: request.AllocationID, MatchID: request.MatchID, ServerID: server.ServerID, State: ServerAllocated, AllocatedAt: now}
allocation := Allocation{AllocationID: request.AllocationID, MatchID: request.MatchID, ServerID: server.ServerID, Region: server.Region, Build: server.Build, Protocol: server.Protocol, Transport: server.Transport, State: ServerAllocated, AllocatedAt: now}
a.allocations[request.AllocationID] = allocation
a.requestHashes[request.AllocationID] = digest
return allocation, nil