Fix process logs not returning
The API endpoint listening for a dump of process logs was not returning logs properly for two reasons: 1. The `id` field was being appended to each log. This had been moved to the `handleLog` function of the `LogHandler`. 2. The slice needed to grab logs from the end, so the `limit` was made negative on the `.slice()`.
This commit is contained in:
parent
dcdcfb5b32
commit
efa21a1915
|
@ -28,7 +28,7 @@ class ProcessLogsApi {
|
|||
(req, res) => {
|
||||
let limit = parseInt(req.query.limit, 10);
|
||||
if (!Number.isInteger(limit)) limit = 0;
|
||||
const result = this.logHandler.logs.map((log, id) => Object.assign(log, {id})).slice(limit);
|
||||
const result = this.logHandler.logs.slice(limit * -1);
|
||||
res.send(JSON.stringify(result));
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue