tasks: rework the startTask API
it is now async. change was required to reset the pending flag
This commit is contained in:
@@ -358,11 +358,7 @@ async function startSyncer() {
|
||||
if (config.provider === 'noop') throw new BoxError(BoxError.BAD_STATE, 'not enabled');
|
||||
|
||||
const taskId = await tasks.add(tasks.TASK_SYNC_EXTERNAL_LDAP, []);
|
||||
|
||||
tasks.startTask(taskId, {}, function (error, result) {
|
||||
debug('sync: done. %o %j', error, result);
|
||||
});
|
||||
|
||||
safe(tasks.startTask(taskId, {}), { debug }); // background
|
||||
return taskId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user