diff --git a/titanembeds/app.py b/titanembeds/app.py index 96976c5..acff020 100644 --- a/titanembeds/app.py +++ b/titanembeds/app.py @@ -35,3 +35,13 @@ def embed_get(guildid, channelid): if 'username' not in session: return redirect(url_for("get_set_username", guildid=guildid, channelid=channelid)) return render_template("embed.html") + +if config.get("redis-stats-endpoint"): + from redislite import Redis + @app.route("/redis-stats") + def redis_stats(): + redis = Redis("redislite.db") + data = [] + for key in redis.keys(): + data.append({"key": key, "value": redis.get(key), "expiration": redis.ttl(key)}) + return jsonify(redis=data)