aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-10-02 15:39:09 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-10-02 15:39:09 +0200
commita6375e69668ea42e19531c6bc68dcd37f3f7cbd7 (patch)
tree03204a408d56311692c3528bedcf95d2455e94f2 /server/initializers/checker.js
parent052937db8a8d282eccdbdf38d487ed8d85d3c0a7 (diff)
parentc4403b29ad4db097af528a7f04eea07e0ed320d0 (diff)
downloadPeerTube-a6375e69668ea42e19531c6bc68dcd37f3f7cbd7.tar.gz
PeerTube-a6375e69668ea42e19531c6bc68dcd37f3f7cbd7.tar.zst
PeerTube-a6375e69668ea42e19531c6bc68dcd37f3f7cbd7.zip
Merge branch 'master' into webseed-merged
Diffstat (limited to 'server/initializers/checker.js')
-rw-r--r--server/initializers/checker.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/initializers/checker.js b/server/initializers/checker.js
index 3831efb8d..91fbcfaf9 100644
--- a/server/initializers/checker.js
+++ b/server/initializers/checker.js
@@ -7,9 +7,9 @@ const Client = mongoose.model('OAuthClient')
7const User = mongoose.model('User') 7const User = mongoose.model('User')
8 8
9const checker = { 9const checker = {
10 checkConfig: checkConfig, 10 checkConfig,
11 clientsExist: clientsExist, 11 clientsExist,
12 usersExist: usersExist 12 usersExist
13} 13}
14 14
15// Check the config files 15// Check the config files
@@ -17,8 +17,8 @@ function checkConfig () {
17 const required = [ 'listen.port', 17 const required = [ 'listen.port',
18 'webserver.https', 'webserver.host', 'webserver.port', 18 'webserver.https', 'webserver.host', 'webserver.port',
19 'database.host', 'database.port', 'database.suffix', 19 'database.host', 'database.port', 'database.suffix',
20 'storage.certs', 'storage.uploads', 'storage.logs', 20 'storage.certs', 'storage.uploads', 'storage.logs', 'storage.thumbnails',
21 'network.friends', 'electron.debug' ] 21 'electron.debug' ]
22 const miss = [] 22 const miss = []
23 23
24 for (const key of required) { 24 for (const key of required) {
@@ -39,10 +39,10 @@ function clientsExist (callback) {
39} 39}
40 40
41function usersExist (callback) { 41function usersExist (callback) {
42 User.list(function (err, users) { 42 User.countTotal(function (err, totalUsers) {
43 if (err) return callback(err) 43 if (err) return callback(err)
44 44
45 return callback(null, users.length !== 0) 45 return callback(null, totalUsers !== 0)
46 }) 46 })
47} 47}
48 48