|
|
|
@ -160,10 +160,10 @@ exports.updateTanklevels = async (req, reply) => {
|
|
|
|
|
const tankId = tank._id;
|
|
|
|
|
const tank_name = tank.tankName
|
|
|
|
|
let capacity = parseInt(tank.capacity.replace(/,/g, ''), 10);
|
|
|
|
|
// let waterLevel = parseInt(tank.waterlevel.replace(/,/g, ''), 10);
|
|
|
|
|
let waterLevel = parseInt(tank.waterlevel.replace(/,/g, ''), 10);
|
|
|
|
|
|
|
|
|
|
const intervalId = setInterval(async function () {
|
|
|
|
|
let waterLevel = parseInt(tank.waterlevel.replace(/,/g, ''), 10);
|
|
|
|
|
|
|
|
|
|
const newWaterLevel = Math.floor(waterLevel - 200);
|
|
|
|
|
|
|
|
|
|
if (newWaterLevel <= 0) {
|
|
|
|
|