mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
fix(energy): lower JODI oil coverage threshold from 60 to 40 (#2764)
JODI 2026 CSVs return 404 (data not yet published). With only 2025 data, the seeder gets 49 countries which fails the >=60 gate. Lowered to 40 to allow partial-year data through. The seeder already fetches current + prior year and merges.
This commit is contained in:
@@ -20,7 +20,7 @@ export const JODI_TTL = 3_024_000; // 35 days
|
||||
const META_KEY = 'seed-meta:energy:jodi-oil';
|
||||
const LOCK_DOMAIN = 'energy:jodi-oil';
|
||||
const LOCK_TTL_MS = 10 * 60 * 1000;
|
||||
const MIN_VALID_COUNTRIES = 60;
|
||||
const MIN_VALID_COUNTRIES = 40;
|
||||
const ANOMALY_DEMAND_KBD = 10_000;
|
||||
|
||||
const JODI_BASE = 'https://www.jodidata.org/_resources/files/downloads/oil-data/annual-csv/';
|
||||
|
||||
@@ -343,13 +343,13 @@ describe('mergeSourceRows', () => {
|
||||
});
|
||||
|
||||
describe('validateCoverage', () => {
|
||||
it('returns true when 60+ countries provided', () => {
|
||||
const countries = Array.from({ length: 60 }, (_, i) => ({ iso2: `C${i}` }));
|
||||
it('returns true when 40+ countries provided', () => {
|
||||
const countries = Array.from({ length: 40 }, (_, i) => ({ iso2: `C${i}` }));
|
||||
assert.equal(validateCoverage(countries), true);
|
||||
});
|
||||
|
||||
it('returns false when fewer than 60 countries', () => {
|
||||
const countries = Array.from({ length: 59 }, (_, i) => ({ iso2: `C${i}` }));
|
||||
it('returns false when fewer than 40 countries', () => {
|
||||
const countries = Array.from({ length: 39 }, (_, i) => ({ iso2: `C${i}` }));
|
||||
assert.equal(validateCoverage(countries), false);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user