-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The codebase has hard-coded magic numbers that appear multiple times and lack clear meaning:
Examples
1. ZIP cleanup timeout (appears twice)
// src/server.ts:84
await cleanupOldZips(24 * 60 * 60 * 1000);
// src/utils/zip-repository.ts
export async function cleanupOldZips(maxAgeMs: number = 24 * 60 * 60 * 1000)2. ZIP size limit
// src/utils/zip-repository.ts
const MAX_ZIP_SIZE = 50 * 1024 * 1024; // 50MBProposed Solution
Create a constants file:
// src/constants.ts
export const ZIP_CLEANUP_AGE_MS = 24 * 60 * 60 * 1000; // 24 hours
export const MAX_ZIP_SIZE_BYTES = 50 * 1024 * 1024; // 50MB
export const DEFAULT_QUERY_LIMIT = 200;
export const MAX_NEIGHBORHOOD_DEPTH = 3;Then import and use:
import { ZIP_CLEANUP_AGE_MS } from './constants';
await cleanupOldZips(ZIP_CLEANUP_AGE_MS);Benefits
- Single source of truth
- Easier to adjust limits
- More maintainable
- Self-documenting
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request