Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
fix: made queue joins process queue
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonHowe committed Jul 18, 2020
1 parent 7c65ae7 commit 38673bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/api/src/modules/websockets/actions/joinQueue.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { queue } from "../gamesData";
import HandlerResponse from "../types/HandlerResponse";
import WebSocket from "ws";
import processQueue from "./processQueue";

export default (data: number, ws: WebSocket): HandlerResponse => {
const changeWSKey = Math.floor(Math.random() * 899999) + 100000;
queue.push({ id: data, ws, changeWSKey });
processQueue();
return {
category: "joinResponse",
data: [{ client: ws, data: { success: true, changeWSKey } }]
Expand Down

0 comments on commit 38673bf

Please sign in to comment.