refactor: streamline Redis caching logic across services

- Implemented a unified `getAndSet` method in RedisService to handle caching for single, list, and paginated responses.
- Removed redundant cache checks and writes in various services, simplifying the code and improving readability.
- Updated GoodsService, StockKeepingUnitsService, PartnerActivatedLicensesService, and others to utilize the new caching mechanism.
- Adjusted Prisma connection limit for better resource management.
This commit is contained in:
2026-05-21 17:27:37 +03:30
parent 1d47fb1a1d
commit 9aa12184a1
16 changed files with 689 additions and 1896 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit, OnModul
password: env('DATABASE_PASSWORD'),
database: env('DATABASE_NAME'),
port: env('DATABASE_PORT') ? Number(env('DATABASE_PORT')) : 3306,
connectionLimit: 50,
connectionLimit: 10,
})
const prismaOptions = getPrismaOptions()