diff options
author | Paweł Dybiec <pawel.to.malpa@gmail.com> | 2019-04-17 17:48:49 +0200 |
---|---|---|
committer | Paweł Dybiec <pawel.to.malpa@gmail.com> | 2019-04-17 17:48:49 +0200 |
commit | 76173530dcacc33725590a7c6d8862fac5466dc3 (patch) | |
tree | 8d87481f094ff0f5c189be7ab95c32e9eb6e8e65 /composer/app/app.py | |
parent | Added vault.password to gitignore (diff) |
Change docker compose dir
Diffstat (limited to 'composer/app/app.py')
-rw-r--r-- | composer/app/app.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/composer/app/app.py b/composer/app/app.py deleted file mode 100644 index 9bf5d90..0000000 --- a/composer/app/app.py +++ /dev/null @@ -1,29 +0,0 @@ -import time - -import redis -from flask import Flask - - -app = Flask(__name__) -cache = redis.Redis(host='redis', port=6379) - - -def get_hit_count(): - retries = 5 - while True: - try: - return cache.incr('hits') - except redis.exceptions.ConnectionError as exc: - if retries == 0: - raise exc - retries -= 1 - time.sleep(0.5) - - -@app.route('/') -def hello(): - count = get_hit_count() - return 'Hello from this site! I have been seen {} times.\n'.format(count) - -if __name__ == "__main__": - app.run(host="0.0.0.0", debug=True) |