replace underscore with our own

we only need like 5 simple functions
This commit is contained in:
Girish Ramakrishnan
2025-02-13 14:03:25 +01:00
parent c46c41db5a
commit dd5e4adc73
25 changed files with 111 additions and 65 deletions
+3 -3
View File
@@ -54,7 +54,7 @@ const assert = require('assert'),
paths = require('./paths.js'),
safe = require('safetydance'),
shell = require('./shell.js')('tasks'),
_ = require('underscore');
_ = require('./underscore.js');
let gTasks = {}; // indexed by task id
@@ -86,7 +86,7 @@ function updateStatus(result) {
// running means actively running
// pending means not actively running
// active mean task is 'done' or not. at this point, clients can stop polling this task.
// active mean task is 'done' or not. at this point, clients can stop polling this task.
// the apptaskmanager sets percent=1 when queued. just a hack to figure non-started but scheduled tasks
result.running = !!gTasks[result.id];
result.active = result.running || result.percent === 1;
@@ -288,7 +288,7 @@ async function getLogs(task, options) {
// removes all fields that are strictly private and should never be returned by API calls
function removePrivateFields(task) {
return _.pick(task, 'id', 'type', 'percent', 'message', 'error', 'active', 'pending', 'creationTime', 'result', 'ts', 'success');
return _.pick(task, ['id', 'type', 'percent', 'message', 'error', 'active', 'pending', 'creationTime', 'result', 'ts', 'success']);
}
async function del(id) {