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

13 lines
414 B
CoffeeScript
Raw Normal View History

2019-09-19 10:05:32 -04:00
# 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
redis = require "../.."
2019-09-19 10:05:32 -04:00
rclient = redis.createClient({host:"localhost",port:"6379"})
setInterval () ->
rclient.healthCheck (err) ->
if err?
console.log "HEALTH CHECK FAILED", err
else
console.log "HEALTH CHECK OK"
, 1000