Fix Cache singleton
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Armin Friedl 2020-10-27 03:19:01 +01:00
parent 4c88eb4121
commit f83f0faa1f
Signed by: armin
GPG key ID: 48C726EEE7FBCBC8

View file

@ -14,8 +14,8 @@ class Cache:
return Cache.__instance return Cache.__instance
def __init__(self): def __init__(self):
if Cache.__instance is None: if Cache.__instance is not None:
raise Exception("Cache is a singleton. Use Cache.getInstance()") raise Exception("Cache is a singleton. Use Cache.get_instance()")
Cache.__instance = self Cache.__instance = self
self.db = Walrus(host='localhost', port=6379, db=0) self.db = Walrus(host='localhost', port=6379, db=0)