mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 19:35:04 -05:00
4b308553be
[misc] move the linting setup to the root of the monorepo GitOrigin-RevId: 1633e2a58598add0b727738cd3bfba0ab7bae781
26 lines
688 B
JavaScript
26 lines
688 B
JavaScript
/*
|
|
execute this script with a redis cluster running to test the health check.
|
|
starting and stopping shards with this script running is a good test.
|
|
|
|
to create a new cluster, use $ ./create-redis-cluster.sh
|
|
to run a chaos monkey, use $ ./clear-dbs.sh
|
|
*/
|
|
|
|
const redis = require('../../../')
|
|
const logger = require('@overleaf/logger')
|
|
|
|
const rclient = redis.createClient({
|
|
cluster: Array.from({ length: 9 }).map((value, index) => {
|
|
return { host: '127.0.0.1', port: 7000 + index }
|
|
}),
|
|
})
|
|
|
|
setInterval(() => {
|
|
rclient.healthCheck(err => {
|
|
if (err) {
|
|
logger.error({ err }, 'HEALTH CHECK FAILED')
|
|
} else {
|
|
logger.log('HEALTH CHECK OK')
|
|
}
|
|
})
|
|
}, 1000)
|