Skip to content

Commit

Permalink
fix: capture "No pollens found" error only for new municipalities
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudambro committed Mar 11, 2024
1 parent 888fdee commit ff076b1
Showing 1 changed file with 41 additions and 9 deletions.
50 changes: 41 additions & 9 deletions api-node/src/getters/pollens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ async function getPollensFromMunicipalityAndDate({
});

if (!pollensJ0) {
capture('No pollens found', {
extra: {
municipality_insee_code,
date_UTC_ISO,
},
tags: {
municipality_insee_code,
},
});
if (!missingMunicipalities.includes(municipality_insee_code)) {
capture('No pollens found', {
extra: {
municipality_insee_code,
date_UTC_ISO,
},
tags: {
municipality_insee_code,
},
});
}
const pollensEmpty: Indicator = {
slug: IndicatorsSlugEnum.pollen_allergy,
name: indicatorsObject[IndicatorsSlugEnum.pollen_allergy].name,
Expand Down Expand Up @@ -256,4 +258,34 @@ async function getPollensForJ1({
return null;
}

const missingMunicipalities = [
'2B033',
'2A004',
'97102',
'97416',
'2A247',
'97407',
'97411',
'97221',
'97110',
'97107',
'2B123',
'2B003',
'2A008',
'2A001',
'97615',
'97227',
'97209',
'97122',
'98818',
'97415',
'97311',
'97213',
'2B353',
'2B311',
'2B307',
'2B063',
'2A284',
];

export { getPollensFromMunicipalityAndDate, getPollensForJ0, getPollensForJ1 };

0 comments on commit ff076b1

Please sign in to comment.