Fix cache
This commit is contained in:
parent
c8ee10b24c
commit
818ad7766e
1 changed files with 2 additions and 3 deletions
|
@ -73,15 +73,14 @@ class DbrandCog(commands.Cog):
|
|||
if len(matches) > 0:
|
||||
search = matches[0]
|
||||
dest = search
|
||||
if not self.cache.contains(dest):
|
||||
data = self.cache.get(dest, None)
|
||||
if not data:
|
||||
api_link = self.api_url + dest
|
||||
data = await self._session.get(api_link)
|
||||
if 200 <= data.status < 400:
|
||||
data = await data.json()
|
||||
else:
|
||||
data = None
|
||||
self.cache.update(dest)
|
||||
data = self.cache.get(dest)
|
||||
fields = None
|
||||
if (
|
||||
data is not None
|
||||
|
|
Loading…
Add table
Reference in a new issue