FIX: affinity and tls config local

This commit is contained in:
marcos-silva-rodrigues
2025-09-03 12:19:30 -03:00
parent 47d8ca2760
commit 8e605aa361
2 changed files with 13 additions and 5 deletions
+1
View File
@@ -13,3 +13,4 @@ hostname: maestro.stg.dadosfera.ai
replicaCount: 1
affinity: null
+12 -5
View File
@@ -5,18 +5,25 @@ import { redisStore } from 'cache-manager-ioredis-yet';
@Module({
imports: [
CacheModule.registerAsync({
useFactory: async () => ({
store: await redisStore({
useFactory: async () => {
const baseRedisConfig = {
ttl: 5 * 1000 * 60, // 5 minute
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT && Number(process.env.REDIS_PORT),
db: process.env.REDIS_DATABASE && Number(process.env.REDIS_DATABASE),
keyPrefix: 'maestro:sso',
tls: {
}
if (process.env.ENV !== 'local') {
baseRedisConfig['tls'] = {
servername: process.env.REDIS_HOST,
}
}),
}),
}
return {
store: await redisStore(baseRedisConfig),
}
},
}),
],
providers: [CacheService],