Fixed some bugs in api and auth services, completed auth cores.

This commit is contained in:
Giuseppe Raffa
2026-05-25 23:14:50 +02:00
parent 318ea3555f
commit 47faa41eb9
41 changed files with 2061 additions and 101 deletions

18
stream/src/data/redis.js Normal file
View File

@@ -0,0 +1,18 @@
import Redis from 'ioredis';
const baseOpts = {
host: process.env.REDIS_HOST,
port: Number(process.env.REDIS_PORT),
password: process.env.REDIS_PASSWORD,
};
// Client principale: SET/GET/SETEX/GETDEL/INCR/PUBLISH
const client = new Redis(baseOpts);
// Client dedicato per SUBSCRIBE (ioredis non permette comandi normali su un client subscribed)
const sub = new Redis(baseOpts);
client.on('error', (e) => console.error('[redis] client error', e.message));
sub.on('error', (e) => console.error('[redis] sub error', e.message));
export { client as redis, sub as redisSub };