mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🎨 Set cache time for wish simulator diary to 24 hour
This commit is contained in:
parent
7b9934fb9b
commit
ce25d8900e
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user