From 089ff2f2046fdbaf9531726eea1f8c6726ebf0c0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 16 Aug 2016 21:51:35 +0200 Subject: Server: optimize function to see if there are users or not --- server/initializers/checker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/initializers/checker.js') diff --git a/server/initializers/checker.js b/server/initializers/checker.js index 3831efb8d..871d3cac2 100644 --- a/server/initializers/checker.js +++ b/server/initializers/checker.js @@ -39,10 +39,10 @@ function clientsExist (callback) { } function usersExist (callback) { - User.list(function (err, users) { + User.count(function (err, totalUsers) { if (err) return callback(err) - return callback(null, users.length !== 0) + return callback(null, totalUsers !== 0) }) } -- cgit v1.2.3