1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-18 19:19:36 +02:00

Split remaining controllers into separate files. Added iOS homescreen icon. Removed additional logging from weather module.

This commit is contained in:
Paweł Malak 2021-11-04 23:39:35 +01:00
parent 88694c7e27
commit 4ed29fe276
32 changed files with 418 additions and 312 deletions

View file

@ -2,23 +2,28 @@ const { Op } = require('sequelize');
const Weather = require('../models/Weather');
const Logger = require('./Logger');
const logger = new Logger();
const loadConfig = require('./loadConfig');
const clearWeatherData = async () => {
const { WEATHER_API_KEY: secret } = await loadConfig();
const weather = await Weather.findOne({
order: [[ 'createdAt', 'DESC' ]]
order: [['createdAt', 'DESC']],
});
if (weather) {
await Weather.destroy({
where: {
id: {
[Op.lt]: weather.id
}
}
})
[Op.lt]: weather.id,
},
},
});
}
logger.log('Old weather data was deleted');
}
if (secret) {
logger.log('Old weather data was deleted');
}
};
module.exports = clearWeatherData;
module.exports = clearWeatherData;