mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-18 19:19:36 +02:00
13 lines
No EOL
419 B
JavaScript
13 lines
No EOL
419 B
JavaScript
const schedule = require('node-schedule');
|
|
const getExternalWeather = require('./getExternalWeather');
|
|
const Sockets = require('../Sockets');
|
|
|
|
const weatherJob = schedule.scheduleJob('updateWeather', '0 */15 * * * *', async () => {
|
|
try {
|
|
await getExternalWeather();
|
|
console.log('weather updated');
|
|
Sockets.getSocket('weather').socket.send('weather updated');
|
|
} catch (err) {
|
|
console.log(err);
|
|
}
|
|
}) |