|
|
|
@ -31,8 +31,12 @@ async function getTasks(req, res) {
|
|
|
|
|
} |
|
|
|
|
// TODO: read async
|
|
|
|
|
let data = fs.readFileSync(path.join(EXPORTED_PATH, item), 'utf8'); |
|
|
|
|
let status = JSON.parse(data); |
|
|
|
|
resp.push(status); |
|
|
|
|
try { |
|
|
|
|
let status = JSON.parse(data); |
|
|
|
|
resp.push(status); |
|
|
|
|
} catch(e) { |
|
|
|
|
console.log(`Cannot read file /exporter/${item}. if this error doesn't repeat, maybe the file is being updated at the moment`); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
res.status(200).send(resp); |
|
|
|
|