Skip to content

Commit

Permalink
fix:socket fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rithick574 committed Jul 10, 2024
1 parent bf03153 commit 2103f1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions chat-service/src/infrastructure/socket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const connectSocketIo = (server: Server) => {

io.on("connection", (socket: Socket) => {
const userId: string = socket.handshake.query.userId as string;
console.log("🚀 ~ file: index.ts:24 ~ io.on ~ userId:", userId)
if (userId) {
userSocketMap[userId] = socket.id;
setLastSeen(userId, new Date(Date.now()));
Expand Down
7 changes: 7 additions & 0 deletions manifests/k8s/ingress-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ spec:
name: learnwise-notification-service
port:
number: 4003
- path: /socket.io
pathType: Prefix
backend:
service:
name: learnwise-chat-service
port:
number: 4006
- path: /api/course
pathType: Prefix
backend:
Expand Down
4 changes: 2 additions & 2 deletions manifests/k8s/services/chat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: learnwise-chat-service
spec:
selector:
app: chat-service
ports:
app: chat-service
ports:
- name: chat-service
protocol: TCP
port: 4006
Expand Down

0 comments on commit 2103f1e

Please sign in to comment.