Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const endTime = Date.now();
return {
...r,
sync_granule_duration: endTime - startTime
};
} catch (e) {
log.error(e);
throw e;
}
};
try {
return await pMap(granules, ingestGranule, { concurrency: 1 });
} finally {
await lock.removeLock(bucket, provider.id, granules[0].granuleId);
}
}
throw err;
}
for (const g of granules) {
try {
const r = await ingest.ingest(g);
updatedGranules.push(r);
}
catch (e) {
await lock.removeLock(bucket, provider.id, g.granuleId);
log.error(e);
throw e;
}
}
await lock.removeLock(bucket, provider.id, granules[0].granuleId);
return updatedGranules;
}