Skip to content

Commit

Permalink
修复一键符文功能有概率失效的问题 (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Nov 7, 2024
1 parent 63e4b2a commit 7ee3967
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions app/lol/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import subprocess
import threading
import time
import traceback
from asyncio import CancelledError
from collections import deque

Expand Down Expand Up @@ -912,22 +913,27 @@ async def getReadyCheckStatus(self):

return await res.json()

@retry()
async def getCurrentRunePage(self):
res = await self.__get("/lol-perks/v1/currentpage")

return await res.json()

@retry()
async def deleteCurrentRunePage(self):
page = await self.getCurrentRunePage()
try:
page = await self.getCurrentRunePage()

res = None
if page.get('isDeletable'):
id = page['id']

res = None
if page.get('isDeletable'):
id = page['id']
res = await self.__delete(f"/lol-perks/v1/pages/{id}")
res = await res.json()

res = await self.__delete(f"/lol-perks/v1/pages/{id}")
res = await res.json()
except Exception as e:
stack = traceback.format_exc()
logger.error(
f"deleteCurrentRunePage error {stack = }, {e =}", TAG)

@retry()
async def createRunePage(self, name, primaryId, secondaryId, perks):
Expand All @@ -940,7 +946,7 @@ async def createRunePage(self, name, primaryId, secondaryId, perks):
}

res = await self.__post("/lol-perks/v1/pages", data=body)
return await res.json()
res = await res.json()

async def spectate(self, summonerName):
info = await self.getSummonerByName(summonerName)
Expand Down

0 comments on commit 7ee3967

Please sign in to comment.