Skip to content

Commit 25b371d

Browse files
Merge pull request #5788 from Countly/SER-1991-ss-taskmanager-uses-comment-field-for-identifying-operation
[core] taskmanager: removed the ability to stop a mongo operation
2 parents 01b6820 + b9d6a67 commit 25b371d

File tree

3 files changed

+1
-48
lines changed

3 files changed

+1
-48
lines changed

api/utils/requestProcessor.js

-11
Original file line numberDiff line numberDiff line change
@@ -828,17 +828,6 @@ const processRequest = (params) => {
828828
});
829829
});
830830
break;
831-
case 'stop':
832-
validateUserForWrite(params, () => {
833-
taskmanager.stopTask({
834-
db: common.db,
835-
id: params.qstring.task_id,
836-
op_id: params.qstring.op_id
837-
}, (err, res) => {
838-
common.returnMessage(params, 200, res);
839-
});
840-
});
841-
break;
842831
case 'delete':
843832
validateUserForWrite(params, () => {
844833
taskmanager.deleteResult({

api/utils/taskmanager.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const log = require('./log.js')('core:taskmanager');
5858
* }, outputData:function(err, data){
5959
* common.returnOutput(params, data);
6060
* }
61-
* }));
61+
* }));
6262
*/
6363
taskmanager.longtask = function(options) {
6464
options.db = options.db || common.db;
@@ -224,9 +224,6 @@ taskmanager.createTask = function(options, callback) {
224224
update.subtask_key = options.subtask_key || "";
225225
update.taskgroup = options.taskgroup || false;
226226
update.linked_to = options.linked_to;
227-
if (options.comment_id) {
228-
update.comment_id = options.comment_id;
229-
}
230227
if (options.subtask && options.subtask !== "") {
231228
update.subtask = options.subtask;
232229
var updateSub = {$set: {}};
@@ -1043,10 +1040,6 @@ taskmanager.rerunTask = function(options, callback) {
10431040
});
10441041
};
10451042

1046-
taskmanager.stopTask = function(options, callback) {
1047-
callback(null, "Operation could not be stopped");
1048-
};
1049-
10501043
/**
10511044
* Create a callback for getting result, including checking gridfs
10521045
* @param {function} callback - callback for the result

frontend/express/public/core/report-manager/javascripts/countly.views.js

-29
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@
127127
canDeleteReport: function() {
128128
return countlyGlobal.member.global_admin || countlyGlobal.admin_apps[countlyCommon.ACTIVE_APP_ID];
129129
},
130-
canStopReport: function() {
131-
return countlyGlobal.member.global_admin || countlyGlobal.admin_apps[countlyCommon.ACTIVE_APP_ID];
132-
},
133130
query: function() {
134131
var q = {};
135132
if (this.fixedOrigin) {
@@ -316,14 +313,6 @@
316313
isDownloadable: function(row) {
317314
return ["views", "dbviewer", "tableExport"].includes(row.type);
318315
},
319-
isStopable: function(row) {
320-
if (row.status === "running" && row.op_id && row.comment_id) {
321-
return true;
322-
}
323-
else {
324-
return false;
325-
}
326-
},
327316
isReadyForView: function(row) {
328317
if (row.linked_to) {
329318
if (row.have_dashboard_widget) {
@@ -342,7 +331,6 @@
342331
},
343332
handleCommand: function(command, row) {
344333
var id = row._id,
345-
op_id = row.op_id,
346334
self = this;
347335

348336
if (id) {
@@ -378,23 +366,6 @@
378366
});
379367
}, [CV.i18n("common.no-dont-do-that"), CV.i18n("taskmanager.yes-rerun-task")], {title: CV.i18n("taskmanager.confirm-rerun-title"), image: "rerunning-task"});
380368
}
381-
else if (command === "stop-task") {
382-
CountlyHelpers.confirm(CV.i18n("taskmanager.confirm-stop"), "popStyleGreen", function(result) {
383-
if (!result) {
384-
return true;
385-
}
386-
self.refresh();
387-
countlyTaskManager.stop(id, op_id, function(res, error) {
388-
if (res.result === "Success") {
389-
countlyTaskManager.monitor(id, true);
390-
self.refresh();
391-
}
392-
else {
393-
CountlyHelpers.alert(error, "red");
394-
}
395-
});
396-
}, [CV.i18n("common.no-dont-do-that"), CV.i18n("taskmanager.yes-stop-task")], {title: CV.i18n("taskmanager.confirm-stop-title"), image: "rerunning-task"});
397-
}
398369
else if (command === "view-task") {
399370
self.$emit("view-task", row);
400371
if (!this.disableAutoNavigationToTask) {

0 commit comments

Comments
 (0)