vendredi 27 mars 2015

Pushing to list in Node.js and running out of memory

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.


Aucun commentaire:

Enregistrer un commentaire