mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 01:13:17 +00:00
Added logger to ready.js
This commit is contained in:
parent
b979d26425
commit
c5f269c0a7
@ -21,19 +21,25 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
client.funcs.logger('Stations', 'Started fetching list – ' + client.config.stationslistUrl);
|
||||||
client.stations = await fetch(client.config.stationslistUrl)
|
client.stations = await fetch(client.config.stationslistUrl)
|
||||||
.then(client.funcs.checkFetchStatus)
|
.then(client.funcs.checkFetchStatus)
|
||||||
.then(response => response.json());
|
.then(response => response.json());
|
||||||
|
client.funcs.logger('Stations', 'Successfully fetched list' + "\n");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//console.error(error);
|
client.funcs.logger('Stations', ' Fetching list failed');
|
||||||
|
console.error(error + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
|
client.funcs.logger('Stations' + 'Started fetching list – ' + client.config.stationslistUrl);
|
||||||
client.stations = await fetch(client.config.stationslistUrl)
|
client.stations = await fetch(client.config.stationslistUrl)
|
||||||
.then(client.funcs.checkFetchStatus)
|
.then(client.funcs.checkFetchStatus)
|
||||||
.then(response => response.json());
|
.then(response => response.json());
|
||||||
|
console.log('Stations', 'Successfully fetched list' + "\n");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
client.funcs.logger('Stations', 'Fetching list failed');
|
||||||
//console.error(error);
|
//console.error(error);
|
||||||
}
|
}
|
||||||
}, 3600000);
|
}, 3600000);
|
||||||
|
Loading…
Reference in New Issue
Block a user