Compare commits
2 Commits
4de052ef0d
...
f7523ae5e2
| Author | SHA1 | Date | |
|---|---|---|---|
| f7523ae5e2 | |||
| 024a43e20b |
@@ -42,7 +42,7 @@ async function run() {
|
|||||||
// scheduled running
|
// scheduled running
|
||||||
if (interval === 0) return;
|
if (interval === 0) return;
|
||||||
logger.debug(`Starting interval (${interval}s)...`);
|
logger.debug(`Starting interval (${interval}s)...`);
|
||||||
runInterval(fetchAndIndex, interval * 1000);
|
runInterval(() => fetchAndIndex().catch(handleError), interval * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
run().catch(handleError);
|
run().catch(handleError);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import fetch from './fetch.mjs';
|
|||||||
|
|
||||||
const formatNumber = str => str && Number(`${str}`.replace(/[^0-9.-]/, ''));
|
const formatNumber = str => str && Number(`${str}`.replace(/[^0-9.-]/, ''));
|
||||||
const formatString = str => {
|
const formatString = str => {
|
||||||
|
if (str == null) return 'N/A';
|
||||||
if (typeof str !== 'string') return str;
|
if (typeof str !== 'string') return str;
|
||||||
return str && str.length && str !== 'undefined' ? str.trim() : 'N/A';
|
return str && str.length && str !== 'undefined' ? str.trim() : 'N/A';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user