mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Server: optimize function to see if there are users or not
This commit is contained in:
parent
0ff21c1c08
commit
089ff2f204
2 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue