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",
|
"caelia",
|
||||||
"Calenelle",
|
"Calenelle",
|
||||||
"callista",
|
"callista",
|
||||||
|
"Chronara",
|
||||||
"cashapp",
|
"cashapp",
|
||||||
"catz",
|
"catz",
|
||||||
"codeofdreams",
|
"codeofdreams",
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
"Deepgram",
|
"Deepgram",
|
||||||
"Eclaire",
|
"Eclaire",
|
||||||
"Eirene",
|
"Eirene",
|
||||||
|
"Ephemere",
|
||||||
"Elaria",
|
"Elaria",
|
||||||
"Elowyn",
|
"Elowyn",
|
||||||
"Elunara",
|
"Elunara",
|
||||||
@@ -61,6 +63,7 @@
|
|||||||
"manuarora",
|
"manuarora",
|
||||||
"maribelle",
|
"maribelle",
|
||||||
"minjo",
|
"minjo",
|
||||||
|
"Minori",
|
||||||
"modeling",
|
"modeling",
|
||||||
"maylin",
|
"maylin",
|
||||||
"Meliora",
|
"Meliora",
|
||||||
@@ -87,6 +90,7 @@
|
|||||||
"Ranjan",
|
"Ranjan",
|
||||||
"Rennemeyer",
|
"Rennemeyer",
|
||||||
"Rion",
|
"Rion",
|
||||||
|
"Rondelle",
|
||||||
"roseaboveit",
|
"roseaboveit",
|
||||||
"rosalia",
|
"rosalia",
|
||||||
"ruus",
|
"ruus",
|
||||||
@@ -103,6 +107,7 @@
|
|||||||
"Sylvara",
|
"Sylvara",
|
||||||
"Takada",
|
"Takada",
|
||||||
"Taryne",
|
"Taryne",
|
||||||
|
"Tatsumi",
|
||||||
"Technomancer",
|
"Technomancer",
|
||||||
"Tessara",
|
"Tessara",
|
||||||
"TTRPG",
|
"TTRPG",
|
||||||
@@ -114,6 +119,7 @@
|
|||||||
"Urmatan",
|
"Urmatan",
|
||||||
"Umbrelle",
|
"Umbrelle",
|
||||||
"Vajda",
|
"Vajda",
|
||||||
|
"Valerium",
|
||||||
"Veluna",
|
"Veluna",
|
||||||
"verena",
|
"verena",
|
||||||
"vitalia",
|
"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 { Resume } from "../src/interfaces/resume.js";
|
||||||
import type { Testimonials } from "../src/interfaces/testimonials.js";
|
import type { Testimonials } from "../src/interfaces/testimonials.js";
|
||||||
|
|
||||||
const MAX_RETRIES = 3;
|
const maxRetries = 3;
|
||||||
const RETRY_DELAY_MS = 2000;
|
const retryDelayMs = 2000;
|
||||||
const RATE_LIMIT_DELAY_MS = 5000;
|
const rateLimitDelayMs = 5000;
|
||||||
|
|
||||||
const sleep = (milliseconds: number): Promise<void> =>
|
const sleep = (milliseconds: number): Promise<void> => {
|
||||||
new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
setTimeout(resolve, milliseconds);
|
setTimeout(resolve, milliseconds);
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const checkUrl = async(url: string, retries = 0): Promise<boolean> => {
|
const checkUrl = async(url: string, retries = 0): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
@@ -32,17 +33,19 @@ const checkUrl = async(url: string, retries = 0): Promise<boolean> => {
|
|||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (retries >= MAX_RETRIES) {
|
if (retries >= maxRetries) {
|
||||||
return false;
|
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...`);
|
console.log(`URL check failed for ${url} (${String(response.status)}), retrying in ${String(delay)}ms...`);
|
||||||
await sleep(delay);
|
await sleep(delay);
|
||||||
return checkUrl(url, retries + 1);
|
return checkUrl(url, retries + 1);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error checking URL ${url}:`, error);
|
console.error(`Error checking URL ${url}:`, error);
|
||||||
if (retries < MAX_RETRIES) {
|
if (retries < maxRetries) {
|
||||||
await sleep(RETRY_DELAY_MS);
|
await sleep(retryDelayMs);
|
||||||
return checkUrl(url, retries + 1);
|
return checkUrl(url, retries + 1);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user