Skip to content

Commit

Permalink
fix inbounds caching wrong format
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdikhody committed Nov 3, 2024
1 parent 7b34275 commit 5addccc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,16 @@ export class Api {
try {
this._logger.debug("Fetching inbounds...");
const inbounds = await this.get<Inbound[]>("/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 [];
Expand Down

0 comments on commit 5addccc

Please sign in to comment.