diff --git a/src/create-contour/index.js b/src/create-contour/index.js index 70d0518..7d22c66 100644 --- a/src/create-contour/index.js +++ b/src/create-contour/index.js @@ -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); @@ -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) - } })); } }