refactor(api): extract hardcoded delay and limit constants in handlers#828
Open
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
Open
refactor(api): extract hardcoded delay and limit constants in handlers#828NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
Conversation
Replace inline magic numbers with named UPPER_SNAKE_CASE constants across 10 server handler files. No logic changes — only extraction of numeric literals into documented module-level constants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@NewCoder3294 is attempting to deploy a commit to the Elie Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace inline magic numbers with named
UPPER_SNAKE_CASEconstants across 10 server handler files. No logic changes -- only extraction of numeric literals into documented module-level constants for clarity and maintainability.Constants extracted
server/worldmonitor/military/v1/get-aircraft-details-batch.tsMAX_BATCH_SIZE10FETCH_DELAY_MS100WINGBITS_TIMEOUT_MS10_000AIRCRAFT_CACHE_TTL24 * 60 * 60server/worldmonitor/positive-events/v1/list-positive-geo-events.tsGDELT_QUERY_DELAY_MS500GDELT_MAX_RECORDS75GDELT_TIMEOUT_MS10_000MIN_EVENT_COUNT3server/worldmonitor/economic/v1/get-energy-capacity.tsEIA_MAX_RESULTS5000EIA_TIMEOUT_MS15_000server/worldmonitor/displacement/v1/get-displacement-summary.tsUNHCR_PAGE_LIMIT10_000MAX_PAGE_GUARD25DEFAULT_FLOW_LIMIT50server/worldmonitor/unrest/v1/list-unrest-events.tsGDELT_MAX_RECORDS250GDELT_TIMEOUT_MS10_000MIN_REPORT_COUNT5HIGH_CONFIDENCE_THRESHOLD20server/worldmonitor/infrastructure/v1/list-internet-outages.tsOUTAGE_QUERY_LIMIT50MAX_ASN_DETAILS2server/worldmonitor/conflict/v1/get-humanitarian-summary.tsHAPI_QUERY_LIMIT1000HAPI_TIMEOUT_MS15_000server/worldmonitor/infrastructure/v1/record-baseline-snapshot.tsMAX_BATCH_UPDATES20server/worldmonitor/economic/v1/get-energy-prices.tsEIA_PRICE_HISTORY_LENGTH2EIA_PRICE_TIMEOUT_MS10_000server/worldmonitor/research/v1/list-hackernews-items.tsDEFAULT_PAGE_SIZE30HN_IDS_TIMEOUT_MS10_000HN_ITEM_TIMEOUT_MS5_000Test plan
tsc --noEmit)🤖 Generated with Claude Code