generated from nhcarrigan/template
chore: fix linting issues in test file and cspell
Add missing words to cspell dictionary and fix ESLint warnings in yaml.spec.ts (naming convention, arrow-body-style, brace-style).
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
"caelia",
|
||||
"Calenelle",
|
||||
"callista",
|
||||
"Chronara",
|
||||
"cashapp",
|
||||
"catz",
|
||||
"codeofdreams",
|
||||
@@ -32,6 +33,7 @@
|
||||
"Deepgram",
|
||||
"Eclaire",
|
||||
"Eirene",
|
||||
"Ephemere",
|
||||
"Elaria",
|
||||
"Elowyn",
|
||||
"Elunara",
|
||||
@@ -61,6 +63,7 @@
|
||||
"manuarora",
|
||||
"maribelle",
|
||||
"minjo",
|
||||
"Minori",
|
||||
"modeling",
|
||||
"maylin",
|
||||
"Meliora",
|
||||
@@ -87,6 +90,7 @@
|
||||
"Ranjan",
|
||||
"Rennemeyer",
|
||||
"Rion",
|
||||
"Rondelle",
|
||||
"roseaboveit",
|
||||
"rosalia",
|
||||
"ruus",
|
||||
@@ -103,6 +107,7 @@
|
||||
"Sylvara",
|
||||
"Takada",
|
||||
"Taryne",
|
||||
"Tatsumi",
|
||||
"Technomancer",
|
||||
"Tessara",
|
||||
"TTRPG",
|
||||
@@ -114,6 +119,7 @@
|
||||
"Urmatan",
|
||||
"Umbrelle",
|
||||
"Vajda",
|
||||
"Valerium",
|
||||
"Veluna",
|
||||
"verena",
|
||||
"vitalia",
|
||||
|
||||
+12
-9
@@ -14,14 +14,15 @@ import type { Projects } from "../src/interfaces/projects.js";
|
||||
import type { Resume } from "../src/interfaces/resume.js";
|
||||
import type { Testimonials } from "../src/interfaces/testimonials.js";
|
||||
|
||||
const MAX_RETRIES = 3;
|
||||
const RETRY_DELAY_MS = 2000;
|
||||
const RATE_LIMIT_DELAY_MS = 5000;
|
||||
const maxRetries = 3;
|
||||
const retryDelayMs = 2000;
|
||||
const rateLimitDelayMs = 5000;
|
||||
|
||||
const sleep = (milliseconds: number): Promise<void> =>
|
||||
new Promise((resolve) => {
|
||||
const sleep = (milliseconds: number): Promise<void> => {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, milliseconds);
|
||||
});
|
||||
};
|
||||
|
||||
const checkUrl = async(url: string, retries = 0): Promise<boolean> => {
|
||||
try {
|
||||
@@ -32,17 +33,19 @@ const checkUrl = async(url: string, retries = 0): Promise<boolean> => {
|
||||
if (response.ok) {
|
||||
return true;
|
||||
}
|
||||
if (retries >= MAX_RETRIES) {
|
||||
if (retries >= maxRetries) {
|
||||
return false;
|
||||
}
|
||||
const delay = response.status === 429 ? RATE_LIMIT_DELAY_MS : RETRY_DELAY_MS;
|
||||
const delay = response.status === 429
|
||||
? rateLimitDelayMs
|
||||
: retryDelayMs;
|
||||
console.log(`URL check failed for ${url} (${String(response.status)}), retrying in ${String(delay)}ms...`);
|
||||
await sleep(delay);
|
||||
return checkUrl(url, retries + 1);
|
||||
} catch (error) {
|
||||
console.error(`Error checking URL ${url}:`, error);
|
||||
if (retries < MAX_RETRIES) {
|
||||
await sleep(RETRY_DELAY_MS);
|
||||
if (retries < maxRetries) {
|
||||
await sleep(retryDelayMs);
|
||||
return checkUrl(url, retries + 1);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user