Skip to content

Commit 78077dc

Browse files
committed
wsgi.py: Flush Redis when starting the app
1 parent b375c19 commit 78077dc

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

wsgi.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import os
44
import logging
55

6+
import redis
7+
68
from portingdb import htmlreport
79

810
level = logging.INFO
@@ -34,4 +36,13 @@
3436

3537

3638
if __name__ == '__main__':
39+
if redis_configured:
40+
# Clear the Redis cache
41+
r = redis.StrictRedis(
42+
host=os.environ['REDIS_SERVICE_HOST'],
43+
port=os.environ['REDIS_SERVICE_PORT'],
44+
password=os.environ['REDIS_PASSWORD'],
45+
db=0,
46+
)
47+
r.flushdb()
3748
application.run(host='0.0.0.0', port=8080)

0 commit comments

Comments
 (0)