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
# clean everything up | |
echo "killing mongod and mongos" | |
killall mongod | |
killall mongos | |
echo "removing data files" | |
rm -rf data/config | |
rm -rf data/shard* | |
# For mac make sure rlimits are high enough to open all necessary connections | |
ulimit -n 2048 |
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
var RingOfPower = function (action, freq) { | |
if (typeof action === "undefined" || typeof freq === "undefined") { | |
throw new Error("must provide a function and an interval"); | |
} | |
this.action = action; | |
this.frequency = freq; | |
}; | |
RingOfPower.prototype.wield = function () { | |
clearInterval(this.interval); |
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
// --- Dependancies --- | |
var _ = require('underscore'); | |
var mongoose = require('mongoose'); | |
// Any function that makes an update to a mongoose model that has an Array field can | |
// use this to catch version errors, and retry the update at most two times | |
var catchVersionErr = function () { | |
var updateFunc, callback, context, args = _.toArray(arguments); | |
context = args.shift(); |
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
You're not testing shards! | |
Please set the MONGOOSE_SHARD_TEST_URI env variable. | |
e.g: `mongodb://localhost:27017/database | |
Sharding must already be enabled on your database | |
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․ | |
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․ | |
You're not testing replica sets! | |
Please set the MONGOOSE_SET_TEST_URI env variable. |
NewerOlder