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

Removed __repr__ as it's not used

This commit is contained in:
phxntxm 2016-08-31 23:41:43 -05:00
parent b031b4d2f5
commit 34bc196c21

View file

@ -41,9 +41,6 @@ class Cache:
self.values = await _get_content(self.key)
self.refreshed = pendulum.utcnow()
def __repr__(self):
return self.values
# Default bot's description
bot_description = global_config.get("description")
@ -127,10 +124,10 @@ 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:
if cached is None or len(cached.values) == 0:
cache[table] = Cache(table)
else:
await cache[table].update()
await cached.update()
async def get_content(key: str):
@ -158,6 +155,7 @@ async def _get_content(key: str):
await conn.close()
items = list(cursor.items)[0]
except (IndexError, r.ReqlOpFailedError):
await conn.close()
return {}
# Rethink db stores an internal id per table, delete this and return the rest
del items['id']