mirror of
https://github.com/Ryujinx/Ryujinx-Ldn-Website.git
synced 2025-08-11 12:01:04 +00:00
Connect to redis before executing requests
This commit is contained in:
parent
e42adddc1b
commit
3dfba2d427
|
@ -4,6 +4,10 @@ import { redisClient } from "./app";
|
|||
const router = Router();
|
||||
|
||||
router.get("/", async (req, res, next) => {
|
||||
if (!redisClient.isOpen) {
|
||||
await redisClient.connect();
|
||||
}
|
||||
|
||||
const result = await redisClient.json.get("ldn");
|
||||
|
||||
if (result == null || typeof result != "object") {
|
||||
|
@ -20,6 +24,10 @@ router.get("/public_games", async (req, res, next) => {
|
|||
gameFilter = req.query.titleid as string;
|
||||
}
|
||||
|
||||
if (!redisClient.isOpen) {
|
||||
await redisClient.connect();
|
||||
}
|
||||
|
||||
const results = await redisClient.json.get("games");
|
||||
|
||||
if (results == null || typeof results != "object") {
|
||||
|
|
Loading…
Reference in a new issue