Commit deb9d24f authored by mercury233's avatar mercury233

Revert "test"

This reverts commit f1ba9741.
parent cafb1b3b
...@@ -1265,8 +1265,8 @@ if settings.modules.mycard_auth and process.env.MYCARD_AUTH_DATABASE ...@@ -1265,8 +1265,8 @@ if settings.modules.mycard_auth and process.env.MYCARD_AUTH_DATABASE
client.query 'SELECT username, id from users', (error, result)-> client.query 'SELECT username, id from users', (error, result)->
throw error if error throw error if error
done() done()
#for row in result.rows for row in result.rows
# users_cache[row.username] = row.id users_cache[row.username] = row.id
console.log("users loaded", _.keys(users_cache).length) console.log("users loaded", _.keys(users_cache).length)
return return
return return
......
...@@ -1535,10 +1535,16 @@ ...@@ -1535,10 +1535,16 @@
throw error; throw error;
} }
client.query('SELECT username, id from users', function(error, result) { client.query('SELECT username, id from users', function(error, result) {
var k, len, ref, row;
if (error) { if (error) {
throw error; throw error;
} }
done(); done();
ref = result.rows;
for (k = 0, len = ref.length; k < len; k++) {
row = ref[k];
users_cache[row.username] = row.id;
}
console.log("users loaded", _.keys(users_cache).length); console.log("users loaded", _.keys(users_cache).length);
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment