Skip to content

Fetch company IDs from Peruserver and cache#34

Merged
MDCYT merged 1 commit intomainfrom
dev
Mar 3, 2026
Merged

Fetch company IDs from Peruserver and cache#34
MDCYT merged 1 commit intomainfrom
dev

Conversation

@MDCYT
Copy link
Copy Markdown
Owner

@MDCYT MDCYT commented Mar 3, 2026

Replace hardcoded COMPANY_IDS with a dynamic fetch from Peruserver (https://peruserver.pe/wp-json/psv/v1/companies). Adds PERUSERVER_COMPANIES_URL and a 6-hour cache (companiesCache) with in-flight deduplication and error handling. Implements refreshCompaniesCache and getCompanies helpers (15s timeout) and uses getCompanies() to select company IDs in both monthly and accumulated flows. Keeps previous cache on errors and updates next refresh time.

Replace hardcoded COMPANY_IDS with a dynamic fetch from Peruserver (https://peruserver.pe/wp-json/psv/v1/companies). Adds PERUSERVER_COMPANIES_URL and a 6-hour cache (companiesCache) with in-flight deduplication and error handling. Implements refreshCompaniesCache and getCompanies helpers (15s timeout) and uses getCompanies() to select company IDs in both monthly and accumulated flows. Keeps previous cache on errors and updates next refresh time.
@MDCYT MDCYT merged commit 95af6f9 into main Mar 3, 2026
1 of 3 checks passed
@deepsource-io
Copy link
Copy Markdown
Contributor

deepsource-io bot commented Mar 3, 2026

DeepSource Code Review

We reviewed changes in 301ca1c...fb2b21a on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Mar 3, 2026 12:42a.m. Review ↗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant