mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
19 lines
448 B
JavaScript
19 lines
448 B
JavaScript
|
const RedisWrapper = require('../../../app/src/infrastructure/RedisWrapper')
|
||
|
const rclient = RedisWrapper.client('health_check')
|
||
|
rclient.on('error', err => {
|
||
|
console.error('Cannot connect to redis.')
|
||
|
console.error(err)
|
||
|
process.exit(1)
|
||
|
})
|
||
|
|
||
|
rclient.healthCheck(err => {
|
||
|
if (err) {
|
||
|
console.error('Cannot connect to redis.')
|
||
|
console.error(err)
|
||
|
process.exit(1)
|
||
|
} else {
|
||
|
console.error('Redis is up.')
|
||
|
process.exit(0)
|
||
|
}
|
||
|
})
|