From eeae66896b205641be5faa931f2e0fc3671ea581 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Maden Date: Wed, 1 Jan 2020 14:27:19 -0800 Subject: [PATCH] [cli] cache last mod AFTER the function call --- pyhmy/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyhmy/cli.py b/pyhmy/cli.py index 7a6e033..fd840a0 100644 --- a/pyhmy/cli.py +++ b/pyhmy/cli.py @@ -69,8 +69,8 @@ def _cache_account_function(fn): key = (args, frozenset(kwargs.items())) mod_hash = hash(_account_keystore_path + str(os.path.getmtime(_account_keystore_path))) if last_mod_hash is None or mod_hash != last_mod_hash or key not in cache.keys(): - last_mod_hash = mod_hash cache[key] = fn(*args, **kwargs) + last_mod_hash = hash(_account_keystore_path + str(os.path.getmtime(_account_keystore_path))) return cache[key] return wrap