mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[misc] test/scripts: use logger-sharelatex for logging as in production
This commit is contained in:
parent
d827b521c6
commit
ccf4bb1e0e
4 changed files with 1123 additions and 4 deletions
1116
libraries/redis-wrapper/package-lock.json
generated
1116
libraries/redis-wrapper/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -29,6 +29,7 @@
|
|||
"eslint-plugin-prettier": "^3.1.3",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.1",
|
||||
"logger-sharelatex": "^2.2.0",
|
||||
"mocha": "^8.2.1",
|
||||
"prettier": "^2.0.2",
|
||||
"prettier-eslint-cli": "^5.0.0",
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
const redis = require('../../../')
|
||||
const logger = require('logger-sharelatex')
|
||||
|
||||
const rclient = redis.createClient({
|
||||
cluster: Array.from({ length: 9 }).map((value, index) => {
|
||||
|
@ -17,9 +18,9 @@ const rclient = redis.createClient({
|
|||
setInterval(() => {
|
||||
rclient.healthCheck((err) => {
|
||||
if (err) {
|
||||
console.log('HEALTH CHECK FAILED', err)
|
||||
logger.error({ err }, 'HEALTH CHECK FAILED')
|
||||
} else {
|
||||
console.log('HEALTH CHECK OK')
|
||||
logger.log('HEALTH CHECK OK')
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
|
|
|
@ -2,15 +2,16 @@
|
|||
// starting and stopping redis with this script running is a good test
|
||||
|
||||
const redis = require('../../')
|
||||
const logger = require('logger-sharelatex')
|
||||
|
||||
const rclient = redis.createClient({ host: 'localhost', port: '6379' })
|
||||
|
||||
setInterval(() => {
|
||||
rclient.healthCheck((err) => {
|
||||
if (err) {
|
||||
console.log('HEALTH CHECK FAILED', err)
|
||||
logger.error({ err }, 'HEALTH CHECK FAILED')
|
||||
} else {
|
||||
console.log('HEALTH CHECK OK')
|
||||
logger.log('HEALTH CHECK OK')
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
|
|
Loading…
Reference in a new issue