From ce25d8900e64e0c7e2b03e9c53819771846ec66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Wed, 6 Dec 2023 22:25:33 +0800 Subject: [PATCH] :art: Set cache time for wish simulator diary to 24 hour --- plugins/genshin/wish.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/genshin/wish.py b/plugins/genshin/wish.py index 56b11ff5..655b41f1 100644 --- a/plugins/genshin/wish.py +++ b/plugins/genshin/wish.py @@ -48,6 +48,7 @@ class GachaRedis: def __init__(self, redis: RedisDB): self.client = redis.client self.qname = "plugin:gacha:" + self.ex = 60 * 60 * 24 async def get(self, user_id: int) -> PlayerGachaInfo: data = await self.client.get(f"{self.qname}{user_id}") @@ -57,7 +58,7 @@ class GachaRedis: async def set(self, user_id: int, player_gacha_info: PlayerGachaInfo): value = player_gacha_info.json() - await self.client.set(f"{self.qname}{user_id}", value) + await self.client.set(f"{self.qname}{user_id}", value, ex=self.ex) class WishSimulatorHandle: