From a0060f0231a98550c27141520e4fe2e8f422288c Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Sun, 22 Jun 2025 08:01:07 +0000 Subject: [PATCH] add database bypass header --- src/common/database.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/database.js b/src/common/database.js index b45afa3e..6938ddcc 100644 --- a/src/common/database.js +++ b/src/common/database.js @@ -15,6 +15,9 @@ export async function storeRequest(req) { if (!pool) { return; } + if (req.headers && req.headers["x-bypass-store"]) { + return; + } const insertQuery = ` INSERT INTO requests (request, requested_at) @@ -96,12 +99,15 @@ async function makeRequests(urls, poolSize) { if (idx >= urls.length) { break; } - const url = "http://" + process.env.VERCEL_BRANCH_URL + urls[idx]; + const url = "https://" + process.env.VERCEL_BRANCH_URL + urls[idx]; try { if (idx % 10 === 0) { console.log(`Processing request ${idx + 1} out of ${urls.length}`); } - await axios.get(url, { timeout: 10000 }); + await axios.get(url, { + timeout: 10000, + headers: { "x-bypass-store": "true" }, + }); } catch (err) { console.error(`Error fetching ${url}:`, err.message); }