fix(commands:peeringdb|Network): possible false positiv

This commit is contained in:
Romain J 2021-04-25 00:14:38 +02:00
parent 9362558a2e
commit 1693857864
2 changed files with 4 additions and 4 deletions

View file

@ -259,7 +259,7 @@ async def get_pydig_result(
@cached(
ttl=24 * 3600,
ttl=5 * 60,
serializer=PickleSerializer(),
cache=Cache.MEMORY,
namespace="network",
@ -269,7 +269,7 @@ async def get_peeringdb_net_result(asn: str) -> dict:
# A. better do one request and save in cache than execute new
# request every time
@cached(
ttl=24 * 3600,
ttl=5 * 60,
serializer=PickleSerializer(),
cache=Cache.MEMORY,
namespace="network",
@ -285,7 +285,7 @@ async def get_peeringdb_net_result(asn: str) -> dict:
except asyncio.exceptions.TimeoutError:
pass
return {"data": []}
return await _local_cache()
result = await _local_cache()

View file

@ -86,7 +86,7 @@ class Network(commands.Cog):
def cog_unload(self):
self._update_peering_db.cancel() # pylint: disable=no-member
@tasks.loop(hours=24.0)
@tasks.loop(minutes=5.0)
async def _update_peering_db(self):
await get_peeringdb_net_result(str(1))