Feature: allow disable ipv6 in proxy, refactor cacheFetch to use proxy (#5011)
Some checks are pending
Docker / Linting Checks (push) Waiting to run
Docker / Docker Build & Push (push) Blocked by required conditions

This commit is contained in:
shamoon
2025-03-16 20:09:34 -07:00
committed by GitHub
parent 934ad3a6f1
commit b4dc53c7c0
10 changed files with 61 additions and 65 deletions

View File

@@ -1,4 +1,4 @@
import cachedFetch from "utils/proxy/cached-fetch";
import { cachedRequest } from "utils/proxy/http";
import { getSettings } from "utils/config/config";
import createLogger from "utils/logger";
@@ -60,7 +60,7 @@ export default async function handler(req, res) {
const apiUrl = `https://finnhub.io/api/v1/quote?symbol=${ticker}&token=${apiKey}`;
// Finnhub free accounts allow up to 60 calls/minute
// https://finnhub.io/pricing
const { c, dp } = await cachedFetch(apiUrl, cache || 1);
const { c, dp } = await cachedRequest(apiUrl, cache || 1);
logger.debug("Finnhub API response for %s: %o", ticker, { c, dp });
// API sometimes returns 200, but values returned are `null`