I am pushing functions onto a list to be called later:
var insertFunctions = [];
insertFunctions.push(function(callback){
newPlayer.save(function (err, result) {
if (err) {
console.log("error in player save method:", err);
callback(err);
return;
}
callback(null,result);
});
});
but I am pushing so many of these I think I am blowing up memory. What's the best way to get around this?
I get Node.js exit code 3, which at this point, means blowing memory to me.