standalone.js 487 B

1234567891011121314151617
  1. // execute this script with a redis container running to test the health check
  2. // starting and stopping redis with this script running is a good test
  3. const redis = require('../../')
  4. const logger = require('@overleaf/logger')
  5. const rclient = redis.createClient({ host: '127.0.0.1', port: '6379' })
  6. setInterval(() => {
  7. rclient.healthCheck(err => {
  8. if (err) {
  9. logger.error({ err }, 'HEALTH CHECK FAILED')
  10. } else {
  11. logger.info('HEALTH CHECK OK')
  12. }
  13. })
  14. }, 1000)