From 5addcccf66c04d82a277eceff2a4c2b804c1ae69 Mon Sep 17 00:00:00 2001 From: Mehdikhody Date: Sun, 3 Nov 2024 06:07:12 +0330 Subject: [PATCH] fix inbounds caching wrong format --- src/api.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api.ts b/src/api.ts index 104524e..fff6bbe 100644 --- a/src/api.ts +++ b/src/api.ts @@ -232,13 +232,16 @@ export class Api { try { this._logger.debug("Fetching inbounds..."); const inbounds = await this.get("/list"); - this._cache.set("inbounds", inbounds); this._logger.debug("Inbounds loaded from API."); - return inbounds.map((inbound) => { - const result = parseInbound(inbound); - this.cacheInbound(result); - return result; + + const result = inbounds.map((inbound) => { + const _result = parseInbound(inbound); + this.cacheInbound(_result); + return _result; }); + + this._cache.set("inbounds", inbounds); + return result; } catch (err) { this._logger.error("Failed to fetch inbounds."); return [];