No need to return args as part of task.get

This reverts commit 831e22b4ff.
This reverts commit 6774514bd2.
This commit is contained in:
Girish Ramakrishnan
2019-12-06 08:40:16 -08:00
parent 2ffb32ae60
commit ffeb484a10
4 changed files with 14 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ exports = module.exports = {
stopTask: stopTask,
stopAllTasks: stopAllTasks,
removePrivateFields: removePrivateFields,
// task types. if you add a task here, fill up the function table in taskworker
TASK_APP: 'app',
TASK_BACKUP: 'backup',
@@ -267,3 +269,9 @@ function getLogs(taskId, options, callback) {
callback(null, transformStream);
}
// removes all fields that are strictly private and should never be returned by API calls
function removePrivateFields(task) {
var result = _.pick(task, 'id', 'type', 'percent', 'message', 'error', 'active', 'creationTime', 'result', 'ts', 'success');
return result;
}