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