From f83f0faa1f2c8f06dc04d2d6de315a7b35f1c361 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Tue, 27 Oct 2020 03:19:01 +0100 Subject: [PATCH] Fix Cache singleton --- countdown/countdown.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/countdown/countdown.py b/countdown/countdown.py index dd3ed89..107fb33 100644 --- a/countdown/countdown.py +++ b/countdown/countdown.py @@ -14,8 +14,8 @@ class Cache: return Cache.__instance def __init__(self): - if Cache.__instance is None: - raise Exception("Cache is a singleton. Use Cache.getInstance()") + if Cache.__instance is not None: + raise Exception("Cache is a singleton. Use Cache.get_instance()") Cache.__instance = self self.db = Walrus(host='localhost', port=6379, db=0)