Forked from FrancescaK/gist:6cdef5dc03388b5a556d
Last active
August 29, 2015 14:04
-
-
Save asya999/e6e14633b13350b32326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanUpLong(max_running_secs) { | |
var currentOps = db.currentOp({ | |
$and: [ | |
{ op: "query" }, | |
{ msg: { $exists: false } }, // not a sharding operation! | |
{ secs_running: { $gt: max_running_secs } }, | |
{"ns": "backstage.action_loc" } | |
] | |
}); | |
currentOps.inprog.forEach(function (op) { | |
db.killOp(op.opid) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lining up appropriate parts of the query.