Revert "Merge branch 'master' into getbundles-fix"

This reverts commit 30168844f3, reversing
changes made to 2e60e2e3d5.
This commit is contained in:
2024-10-24 10:59:09 -04:00
parent c9ecbb911a
commit 1d48499c64
14 changed files with 168 additions and 546 deletions

View File

@@ -1,6 +1,7 @@
"use strict";
import { Service, ServiceBroker, ServiceSchema, Context } from "moleculer";
import { JobType } from "moleculer-bullmq";
import { createClient } from "redis";
import { createAdapter } from "@socket.io/redis-adapter";
import Session from "../models/session.model";
import { pubClient, subClient } from "../config/redis.config";
@@ -273,22 +274,6 @@ export default class SocketService extends Service {
},
},
async started() {
this.logger.info("Starting Socket Service...");
this.logger.debug("pubClient:", pubClient);
this.logger.debug("subClient:", subClient);
if (!pubClient || !subClient) {
this.logger.error("Redis clients are not initialized!");
throw new Error("Redis clients are not initialized!");
}
// Additional checks or logic if necessary
if (pubClient.status !== "ready") {
await pubClient.connect();
}
if (subClient.status !== "ready") {
await subClient.connect();
}
this.io.on("connection", async (socket) => {
console.log(
`socket.io server connected to client with session ID: ${socket.id}`