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

18 lines
489 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 10:05:32 -04:00
const redis = require('../../')
const logger = require('logger-sharelatex')
2019-09-19 10:05:32 -04:00
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)