diff --git a/modules/cache.js b/modules/cache.js index b350b8f..9e850cf 100644 --- a/modules/cache.js +++ b/modules/cache.js @@ -8,12 +8,12 @@ function connect_redis() { var redisURL = require("url").parse(process.env.REDISCLOUD_URL); redis = require("redis").createClient(redisURL.port, redisURL.hostname); redis.auth(redisURL.auth.split(":")[1]); - redis.flushall(); } else { redis = require("redis").createClient(); } redis.on("ready", function() { console.log("Redis connection established."); + redis.flushall(); }); redis.on("error", function (err) { console.error(err); diff --git a/test/bulk.sh b/test/bulk.sh index 6b7feed..5267027 100755 --- a/test/bulk.sh +++ b/test/bulk.sh @@ -1,4 +1,9 @@ #!/bin/bash +host="$1" +if [ -z "$host" ]; then + echo "Usage: $0 " + exit 1 +fi dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rm -f "$dir/../skins/"*.png || exit 1 for uuid in `cat "$dir/uuids.txt"`; do @@ -8,5 +13,5 @@ for uuid in `cat "$dir/uuids.txt"`; do if [ "$(( ((RANDOM<<15)|RANDOM) % 2 ))" -eq "1" ]; then helm="&helm" fi - curl -sS -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "http://crafatar.com/avatars/$uuid?size=$size$helm" || exit 1 + curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "http://$host/avatars/$uuid?size=$size$helm" || exit 1 done