chore: fix linting issues in test file and cspell
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 58s
Node.js CI / CI (pull_request) Failing after 1m6s

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:
2026-04-28 13:09:54 -07:00
parent 5cfd681623
commit d15ebc14a0
2 changed files with 18 additions and 9 deletions
+12 -9
View File
@@ -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;