Skip to content

Commit

Permalink
fix: remove info logging within loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sdobbert authored and sdobbert committed Mar 5, 2024
1 parent 7db6387 commit b1c93c3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/create-contour/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ const contourLinesWorker = async (workerJob, inputs) => {
const temp = contourLine.properties.TEMP;

// delete old rows with redundant timestamp
let deleteRows = await client.query(`DELETE FROM ${region}_contourLines WHERE timestamp = '${timestamp}';`);
logger.info(`Deleted ${deleteRows.rowCount} row`);
await client.query(`DELETE FROM ${region}_contourLines WHERE timestamp = '${timestamp}';`);

// add new rows to table
let insertRow = await client.query(`INSERT INTO ${region}_contourLines(timestamp, geom, temperature) VALUES('${timestamp}', ST_GeomFromGeoJSON('${geom}'), ${temp});`);
logger.info(`Inserted ${insertRow.rowCount} row`);
await client.query(`INSERT INTO ${region}_contourLines(timestamp, geom, temperature) VALUES('${timestamp}', ST_GeomFromGeoJSON('${geom}'), ${temp});`);
}
} catch (e) {
logger.error('SQL execution aborted:' + e);
Expand All @@ -100,9 +98,6 @@ const contourLinesWorker = async (workerJob, inputs) => {

await fs.unlink(file, (err => {
if (err) logger.error(err);
else {
logger.info('Deleted file:', file)
}
}));
}
}
Expand Down

0 comments on commit b1c93c3

Please sign in to comment.