Skip to content

Instantly share code, notes, and snippets.

@asya999
Forked from FrancescaK/gist:6cdef5dc03388b5a556d
Last active August 29, 2015 14:04
Show Gist options
  • Save asya999/e6e14633b13350b32326 to your computer and use it in GitHub Desktop.
Save asya999/e6e14633b13350b32326 to your computer and use it in GitHub Desktop.
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)
})
}
@asya999
Copy link
Author

asya999 commented Aug 1, 2014

lining up appropriate parts of the query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment