mirror of https://github.com/status-im/codimd.git
Merge branch 'develop' into release-2.1.0
This commit is contained in:
commit
168fdf35c3
|
@ -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))
|
||||
})
|
||||
}
|
||||
|
|
|
@ -4,14 +4,19 @@ const realtime = require('../realtime/realtime')
|
|||
const config = require('../config')
|
||||
|
||||
exports.getStatus = async (req, res) => {
|
||||
const data = await realtime.getStatus()
|
||||
|
||||
res.set({
|
||||
'Cache-Control': 'private', // only cache by client
|
||||
'X-Robots-Tag': 'noindex, nofollow', // prevent crawling
|
||||
'Content-Type': 'application/json'
|
||||
})
|
||||
res.send(data)
|
||||
|
||||
try {
|
||||
const data = await realtime.getStatus()
|
||||
res.send(data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
res.status(500).send(e.toString())
|
||||
}
|
||||
}
|
||||
|
||||
exports.getMetrics = async (req, res) => {
|
||||
|
|
Loading…
Reference in New Issue