overleaf/libraries/redis-wrapper/test/scripts/standalone.js

18 lines
487 B
JavaScript
Raw Normal View History

// 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
2019-09-19 14:05:32 +00:00
const redis = require('../../')
const logger = require('@overleaf/logger')
2019-09-19 14:05:32 +00:00
const rclient = redis.createClient({ host: '127.0.0.1', port: '6379' })
setInterval(() => {
rclient.healthCheck(err => {
if (err) {
logger.error({ err }, 'HEALTH CHECK FAILED')
} else {
logger.info('HEALTH CHECK OK')
}
})
}, 1000)