overleaf/libraries/redis-wrapper/test/scripts/standalone.js
Jakob Ackermann 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages
[misc] move the linting setup to the root of the monorepo

GitOrigin-RevId: 1633e2a58598add0b727738cd3bfba0ab7bae781
2021-12-17 09:03:06 +00:00

17 lines
486 B
JavaScript

// execute this script with a redis container running to test the health check
// starting and stopping redis with this script running is a good test
const redis = require('../../')
const logger = require('@overleaf/logger')
const rclient = redis.createClient({ host: 'localhost', port: '6379' })
setInterval(() => {
rclient.healthCheck(err => {
if (err) {
logger.error({ err }, 'HEALTH CHECK FAILED')
} else {
logger.log('HEALTH CHECK OK')
}
})
}, 1000)