Compare commits

...
3 Commits
3 changed files with 14 additions and 5 deletions
+1
View File
@@ -13,3 +13,4 @@ hostname: maestro.stg.dadosfera.ai
replicaCount: 1 replicaCount: 1
affinity: null
+1
View File
@@ -114,6 +114,7 @@ export class AuthController {
return res.send(data); return res.send(data);
} catch (error) { } catch (error) {
this.logger.error('/auth - SignIn - ERROR', error); this.logger.error('/auth - SignIn - ERROR', error);
throw error;
} }
} }
+12 -5
View File
@@ -5,18 +5,25 @@ import { redisStore } from 'cache-manager-ioredis-yet';
@Module({ @Module({
imports: [ imports: [
CacheModule.registerAsync({ CacheModule.registerAsync({
useFactory: async () => ({ useFactory: async () => {
store: await redisStore({ const baseRedisConfig = {
ttl: 5 * 1000 * 60, // 5 minute ttl: 5 * 1000 * 60, // 5 minute
host: process.env.REDIS_HOST, host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT && Number(process.env.REDIS_PORT), port: process.env.REDIS_PORT && Number(process.env.REDIS_PORT),
db: process.env.REDIS_DATABASE && Number(process.env.REDIS_DATABASE), db: process.env.REDIS_DATABASE && Number(process.env.REDIS_DATABASE),
keyPrefix: 'maestro:sso', keyPrefix: 'maestro:sso',
tls: { }
if (process.env.ENV !== 'local') {
baseRedisConfig['tls'] = {
servername: process.env.REDIS_HOST, servername: process.env.REDIS_HOST,
} }
}), }
}),
return {
store: await redisStore(baseRedisConfig),
}
},
}), }),
], ],
providers: [CacheService], providers: [CacheService],