mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +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):
|
def __init__(self, redis: RedisDB):
|
||||||
self.client = redis.client
|
self.client = redis.client
|
||||||
self.qname = "plugin:gacha:"
|
self.qname = "plugin:gacha:"
|
||||||
|
self.ex = 60 * 60 * 24
|
||||||
|
|
||||||
async def get(self, user_id: int) -> PlayerGachaInfo:
|
async def get(self, user_id: int) -> PlayerGachaInfo:
|
||||||
data = await self.client.get(f"{self.qname}{user_id}")
|
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):
|
async def set(self, user_id: int, player_gacha_info: PlayerGachaInfo):
|
||||||
value = player_gacha_info.json()
|
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:
|
class WishSimulatorHandle:
|
||||||
|
Loading…
Reference in New Issue
Block a user