Skip to content

Commit 89c46d4

Browse files
committed
more cleanup
1 parent 154e37f commit 89c46d4

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

api/utils/taskmanager.js

+1-30
Original file line numberDiff line numberDiff line change
@@ -956,36 +956,7 @@ taskmanager.rerunTask = function(options, callback) {
956956
};
957957

958958
taskmanager.stopTask = function(options, callback) {
959-
options.db = options.db || common.db;
960-
961-
/**
962-
* Stop task
963-
* @param {funciton} callback1 - callback for the result
964-
*/
965-
function stopTask() {
966-
callback(null, "Operation could not be stopped");
967-
}
968-
969-
options.db.collection("long_tasks").findOne({ _id: options.id }, function(err, res) {
970-
if (res) {
971-
if (res.creator) {
972-
options.db.collection("members").findOne({ _id: common.db.ObjectID(res.creator) }, function(err1, member) {
973-
if (member) {
974-
stopTask(res.op_id);
975-
}
976-
else {
977-
callback(null, "No permission to stop this task");
978-
}
979-
});
980-
}
981-
else {
982-
stopTask(res.op_id);
983-
}
984-
}
985-
else {
986-
callback(null, "Task does not exist");
987-
}
988-
});
959+
callback(null, "Operation could not be stopped");
989960
};
990961

991962
/**

0 commit comments

Comments
 (0)