mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 14:39:25 +08:00
add: luahook api retry
This commit is contained in:
@@ -5,6 +5,7 @@ import requests
|
||||
import adbutils
|
||||
from pydantic import BaseModel
|
||||
|
||||
from module.base.retry import retry
|
||||
from module.luahook.exception import CrackerError
|
||||
|
||||
|
||||
@@ -57,6 +58,7 @@ class CrackApi:
|
||||
self.api_url = base_url
|
||||
self.timeout = timeout
|
||||
|
||||
@retry(tries=3, delay=3)
|
||||
def get(self, path, **kwargs):
|
||||
args = []
|
||||
for k, v in kwargs.items():
|
||||
@@ -79,6 +81,7 @@ class CrackApi:
|
||||
raise CrackerError(f'CrackApi response error: {response.status_code}')
|
||||
return response
|
||||
|
||||
@retry(tries=3, delay=3)
|
||||
def post(self, path, data=None):
|
||||
url = f'{self.api_url}/{path}'
|
||||
if data is not None and isinstance(data, dict):
|
||||
|
||||
Reference in New Issue
Block a user