mirror of https://github.com/status-im/codimd.git
fix: getStatus should reject promise
1. reject promise when getStatus failed 2. change to use promise-way call getStatus in debug message Signed-off-by: Raccoon <raccoon@hackmd.io>
This commit is contained in:
parent
54ab0a08de
commit
a3742e4564
|
@ -298,10 +298,12 @@ function getStatus () {
|
|||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
return logger.error('count user failed: ' + err)
|
||||
logger.error('count user failed: ' + err)
|
||||
return Promise.reject(new Error('count user failed: ' + err))
|
||||
})
|
||||
}).catch(function (err) {
|
||||
return logger.error('count note failed: ' + err)
|
||||
logger.error('count note failed: ' + err)
|
||||
return Promise.reject(new Error('count note failed: ' + err))
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -772,8 +774,7 @@ function queueForConnect (socket) {
|
|||
const noteId = socket.noteId
|
||||
logger.info('SERVER connected a client to [' + noteId + ']:')
|
||||
logger.info(JSON.stringify(user))
|
||||
// logger.info(notes);
|
||||
getStatus(function (data) {
|
||||
getStatus().then(function (data) {
|
||||
logger.info(JSON.stringify(data))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue