⬆️ Bumped dep versions and socket.io-redis upgrade

This commit is contained in:
2023-03-21 21:38:07 -04:00
parent 65c762d689
commit 7b59f5f94d
6 changed files with 4013 additions and 16217 deletions

View File

@@ -75,6 +75,7 @@ export default class ImportService extends Service {
return await walkFolder(ctx.params.basePathToWalk, [
".cbz",
".cbr",
".cb7",
]);
},
},

View File

@@ -1,10 +1,16 @@
"use strict";
import { Service, ServiceBroker, ServiceSchema } from "moleculer";
import { createClient } from "redis";
import { createAdapter } from "@socket.io/redis-adapter";
const SocketIOService = require("moleculer-io");
const redisAdapter = require("socket.io-redis");
const redisURL = new URL(process.env.REDIS_URI);
console.log(redisURL.hostname);
// console.log(redisURL.hostname);
const pubClient = createClient({ url: `redis://${redisURL.hostname}:6379` });
(async () => {
await pubClient.connect();
})();
const subClient = pubClient.duplicate();
export default class SocketService extends Service {
// @ts-ignore
public constructor(
@@ -66,10 +72,7 @@ export default class SocketService extends Service {
},
},
options: {
adapter: redisAdapter({
host: redisURL.hostname,
port: 6379,
}),
adapter: createAdapter(pubClient, subClient),
},
},
},