catch errors while filling the cache
This commit is contained in:
parent
dc01956269
commit
5f9074e086
1 changed files with 13 additions and 8 deletions
|
@ -25,6 +25,8 @@ async function fill() {
|
||||||
const timestamp = new Date();
|
const timestamp = new Date();
|
||||||
logger.debug('filling cache...');
|
logger.debug('filling cache...');
|
||||||
clear();
|
clear();
|
||||||
|
try {
|
||||||
|
|
||||||
if (modep === undefined) {
|
if (modep === undefined) {
|
||||||
modep = require('./modep.js');
|
modep = require('./modep.js');
|
||||||
}
|
}
|
||||||
|
@ -34,6 +36,9 @@ async function fill() {
|
||||||
await modep.getCurrentPedalboard();
|
await modep.getCurrentPedalboard();
|
||||||
await modep.getCurrentPedals();
|
await modep.getCurrentPedals();
|
||||||
logger.debug('cache filled after ' + timeDiff(timestamp) + 'ms');
|
logger.debug('cache filled after ' + timeDiff(timestamp) + 'ms');
|
||||||
|
} catch (err) {
|
||||||
|
logger.error('encountered an error while filling the cache after ' + timeDiff(timestamp) + 'ms');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
|
|
Loading…
Reference in a new issue