Skip to content

Commit 58f9b3b

Browse files
committed
Update context so cleaning up after cancellation works
1 parent 021eade commit 58f9b3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/matching-service/handlers/websocket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ func waitForResult(ws *websocket.Conn, ctx, timeoutCtx, matchCtx context.Context
126126
case <-ctx.Done():
127127
log.Println("Matching cancelled")
128128
// Cleanup Redis
129-
processes.CleanUpUser(processes.GetRedisClient(), username, ctx)
129+
processes.CleanUpUser(processes.GetRedisClient(), username, context.Background())
130130
return
131131
case <-timeoutCtx.Done():
132132
log.Println("Connection timed out")
133133
// Cleanup Redis
134-
processes.CleanUpUser(processes.GetRedisClient(), username, ctx)
134+
processes.CleanUpUser(processes.GetRedisClient(), username, context.Background())
135135
sendTimeoutResponse(ws)
136136
return
137137
case <-matchCtx.Done():

0 commit comments

Comments
 (0)