move all db and cache logic from service to repositories

This commit is contained in:
rafiarrafif
2025-05-25 21:37:55 +07:00
parent 03fd0531af
commit ee8e8d08db
6 changed files with 76 additions and 11 deletions

View File

@ -0,0 +1,13 @@
import { AppError } from "../../../helpers/error/instances/app";
import { redis } from "../../../utils/databases/redis/connection";
export const checkUserSessionInCacheRepo = async (redisKeyName: string) => {
try {
const userSessionInRedis = await redis.exists(redisKeyName);
if (!userSessionInRedis) return false;
return userSessionInRedis;
} catch (error) {
throw new AppError(500, "Server cache error");
}
};