Skip to content

Commit

Permalink
fix:format the file
Browse files Browse the repository at this point in the history
Signed-off-by: pallavicoder <pallavi.ghule@ayanworks.com>
  • Loading branch information
pallavighule committed Dec 3, 2024
1 parent 5e3ead1 commit 537deaf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ void connect({
process.env.SHORTENER_BASE_URL = `${url}/s`

require('./src/index')
})
})
2 changes: 1 addition & 1 deletion src/transport/ProcessInboundMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export async function processInboundMessage(req: Request, res: Response, agent:
if (!res.headersSent) {
res.status(500).send('Error processing message')
}
}
}
}
49 changes: 23 additions & 26 deletions src/transport/SocketIdManager.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@


class SocketIdsManager {
private active_connections : Record<string , unknown> = {}
private active_connections: Record<string, unknown> = {}

private static instance: SocketIdsManager;
private static instance: SocketIdsManager

private constructor() {}
private constructor() {}

public static getInstance() : SocketIdsManager {
if(!SocketIdsManager.instance){
SocketIdsManager.instance = new SocketIdsManager()
}
return SocketIdsManager.instance;
public static getInstance(): SocketIdsManager {
if (!SocketIdsManager.instance) {
SocketIdsManager.instance = new SocketIdsManager()
}

public addSocketId(socketId:string) : string {
this.active_connections[socketId] = socketId;
return socketId;
}

public removeSocketId(socketId : string) : string {
delete this.active_connections[socketId]
return socketId;
}

public getConnectionBySocketId(socketId : string) : any {
return this.active_connections[socketId]
}

return SocketIdsManager.instance
}

public addSocketId(socketId: string): string {
this.active_connections[socketId] = socketId
return socketId
}

public removeSocketId(socketId: string): string {
delete this.active_connections[socketId]
return socketId
}

public getConnectionBySocketId(socketId: string): any {
return this.active_connections[socketId]
}
}

export { SocketIdsManager}
export { SocketIdsManager }

0 comments on commit 537deaf

Please sign in to comment.