Created
July 31, 2014 16:25
-
-
Save FrancescaK/6cdef5dc03388b5a556d to your computer and use it in GitHub Desktop.
soundwave_6
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