From 680d9a28115167b47dc390effce147e78e3b66c6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 13 Oct 2013 16:39:45 +0100 Subject: [PATCH] Don't try to populate padlist on each req This is an important fix, prolly wants merging into master ASAP. Before this fix each new pad request would re-populate the all pads object, this is a blocking procedure and slows down the loading to a point where it's almost useless :( Testing didn't find this because our testing stack isn't populated with pad data :| TLDR. Our tests still suck, hard. --- src/node/db/PadManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 120649a2d..007726088 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -38,7 +38,7 @@ var globalPads = { { this[':'+name] = value; - if(!padList.list.length == 0){ // If we haven't populated the padList.list yet + if(padList.list.length == 0){ // If we haven't populated the padList.list yet padList.init(); } @@ -163,7 +163,7 @@ exports.getPad = function(id, text, callback) exports.listAllPads = function(callback) { - if(!padList.list.length == 0){ // If we haven't populated the padList.list yet + if(padList.list.length == 0){ // If we haven't populated the padList.list yet padList.init(); } if(callback != null){ @@ -231,7 +231,7 @@ exports.isValidPadId = function(padId) * Removes the pad from database and unloads it. */ exports.removePad = function(padId){ - if(!padList.list.length == 0){ // If we haven't populated the padList.list yet + if(padList.list.length == 0){ // If we haven't populated the padList.list yet padList.init(); } db.remove("pad:"+padId);