Skip to content

Instantly share code, notes, and snippets.

@FrancescaK
Created July 31, 2014 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save FrancescaK/6cdef5dc03388b5a556d to your computer and use it in GitHub Desktop.
Save FrancescaK/6cdef5dc03388b5a556d to your computer and use it in GitHub Desktop.
soundwave_6
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