1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Added another check in case cached object failed

This commit is contained in:
phxntxm 2016-08-31 23:44:45 -05:00
parent 34bc196c21
commit 3b66f780a9

View file

@ -124,7 +124,7 @@ async def save_content(table: str, content):
# Now that we've saved the new content, we should update our cache
cached = cache.get(table)
# While this should theoretically never happen, we just want to make sure
if cached is None or len(cached.values) == 0:
if cached is None or isinstance(cached, {}) or len(cached.values) == 0:
cache[table] = Cache(table)
else:
await cached.update()