Skip to content

Commit e1af8a0

Browse files
committed
remove comment
1 parent d259255 commit e1af8a0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

matching-service/src/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ app.use(cors({ origin: true, credentials: true }));
2525
// Mainly to check health or state of service
2626
app.use(`${apiVersion}/`, messageRoutes);
2727

28-
// Modify the notifyMatch function to use the WebSocketService
2928
export const notifyMatch = async (
3029
user1Id: string,
3130
user2Id: string,

matching-service/src/services/matchingService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from "../model/userModel";
88
import { User } from "../types";
99
import { sendToQueue } from "./rabbitMqService";
10-
import { notifyMatch } from "../app"; // Add this import at the top of the file
10+
import { notifyMatch } from "../app";
1111

1212
/**
1313
* Check match in queue, if there is a match, we will remove that user from the queue, and return

matching-service/src/services/webSocketService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { removeUserFromKey } from "../model/userModel";
77
class WebSocketService {
88
private wss: WebSocket.Server;
99
private clients: Map<string, CustomWebSocket> = new Map();
10+
// need a pending notif map as new users will not be connected before the notifyMatch() function is called
1011
private pendingNotifications: Map<string, any> = new Map();
1112

1213
constructor(server: http.Server) {
@@ -105,6 +106,7 @@ class WebSocketService {
105106
}
106107
};
107108

109+
// notify both users
108110
await notifyUser(user1Id);
109111
await notifyUser(user2Id);
110112
}

0 commit comments

Comments
 (0)