Use result in db instead of ipc

This commit is contained in:
Girish Ramakrishnan
2018-11-29 15:16:31 -08:00
parent d9f3f64c76
commit 2f729b56fa
6 changed files with 34 additions and 49 deletions

View File

@@ -3,6 +3,7 @@
exports = module.exports = {
setProgress: setProgress,
getProgress: getProgress,
clearProgress: clearProgress,
stopTask: stopTask,
@@ -70,6 +71,13 @@ function getProgress(id, callback) {
});
}
function clearProgress(id, callback) {
assert.strictEqual(typeof id, 'string');
assert.strictEqual(typeof callback, 'function');
setProgress(id, { percent: 0, message: 'Starting', result: '', errorMessage: '' }, callback);
}
function stopTask(id, auditSource, callback) {
assert.strictEqual(typeof id, 'string');
assert.strictEqual(typeof auditSource, 'object');