mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-18 19:19:36 +02:00
Removed additional weather logging
This commit is contained in:
parent
07cd725d4a
commit
51a0da8f10
3 changed files with 1 additions and 12 deletions
|
@ -79,8 +79,6 @@ export const AuthForm = (): JSX.Element => {
|
||||||
setFormData({ ...formData, duration: e.target.value })
|
setFormData({ ...formData, duration: e.target.value })
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<option value="5s">dev: 5 seconds</option>
|
|
||||||
<option value="10s">dev: 10 seconds</option>
|
|
||||||
<option value="1h">1 hour</option>
|
<option value="1h">1 hour</option>
|
||||||
<option value="1d">1 day</option>
|
<option value="1d">1 day</option>
|
||||||
<option value="14d">2 weeks</option>
|
<option value="14d">2 weeks</option>
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
const { Op } = require('sequelize');
|
const { Op } = require('sequelize');
|
||||||
const Weather = require('../models/Weather');
|
const Weather = require('../models/Weather');
|
||||||
const Logger = require('./Logger');
|
|
||||||
const logger = new Logger();
|
|
||||||
const loadConfig = require('./loadConfig');
|
|
||||||
|
|
||||||
const clearWeatherData = async () => {
|
const clearWeatherData = async () => {
|
||||||
const { WEATHER_API_KEY: secret } = await loadConfig();
|
|
||||||
|
|
||||||
const weather = await Weather.findOne({
|
const weather = await Weather.findOne({
|
||||||
order: [['createdAt', 'DESC']],
|
order: [['createdAt', 'DESC']],
|
||||||
});
|
});
|
||||||
|
@ -20,10 +15,6 @@ const clearWeatherData = async () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secret) {
|
|
||||||
logger.log('Old weather data was deleted');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = clearWeatherData;
|
module.exports = clearWeatherData;
|
||||||
|
|
|
@ -15,7 +15,7 @@ const weatherJob = schedule.scheduleJob(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const weatherData = await getExternalWeather();
|
const weatherData = await getExternalWeather();
|
||||||
logger.log('Weather updated');
|
|
||||||
Sockets.getSocket('weather').socket.send(JSON.stringify(weatherData));
|
Sockets.getSocket('weather').socket.send(JSON.stringify(weatherData));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (secret) {
|
if (secret) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue