This commit is contained in:
Cat /dev/Nulo 2024-09-01 14:01:27 -03:00
parent 2d6804a409
commit 8729bb0108

View file

@ -32,11 +32,15 @@ const s3 = new S3Client({
}); });
async function getRawDatasetInfo() { async function getRawDatasetInfo() {
try {
const response = await fetchWithRetry( const response = await fetchWithRetry(
"https://datos.produccion.gob.ar/api/3/action/package_show?id=sepa-precios", "https://datos.produccion.gob.ar/api/3/action/package_show?id=sepa-precios",
); );
const json = await response.json(); return await response.json();
return json; } catch (error) {
console.error(`❌ Error fetching dataset info`, error, `retrying in 5min...`);
await new Promise((resolve) => setTimeout(resolve, 5 * 60 * 1000));
return await getRawDatasetInfo();
} }
async function saveDatasetInfoIntoRepo(datasetInfo: any) { async function saveDatasetInfoIntoRepo(datasetInfo: any) {