代码优化
This commit is contained in:
parent
7d4ed53a59
commit
ef79c45d78
|
|
@ -6,13 +6,13 @@ import os
|
|||
bind = "0.0.0.0:8012"
|
||||
|
||||
# 工作进程数
|
||||
workers = multiprocessing.cpu_count() * 2 + 1
|
||||
workers = 3
|
||||
|
||||
# 工作进程类型
|
||||
worker_class = "uvicorn.workers.UvicornWorker"
|
||||
|
||||
# 工作进程超时时间
|
||||
timeout = 120
|
||||
timeout = 600
|
||||
|
||||
# 保持连接
|
||||
keepalive = 5
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ class DealAllTask:
|
|||
payload = {"padCodes": pad_code, "realIphoneTemplateId": 37}
|
||||
return self.send_post_get(api_endpoint, payload)
|
||||
|
||||
|
||||
def set_network_proxy(self, pad_code: list[str], country: str, proxy_platform="kkoip"):
|
||||
if proxy_platform == "kkoip":
|
||||
self.logger.info(f"{pad_code}使用kkoip")
|
||||
|
|
@ -139,7 +138,9 @@ class DealAllTask:
|
|||
|
||||
def check_phone_status(self, pad_code: list[str], file_name: str, times=10):
|
||||
count = 0
|
||||
self.logger.info(f"{pad_code};{file_name},开始等待180秒")
|
||||
time.sleep(180)
|
||||
self.logger.info(f"{pad_code};{file_name},等待180秒结束")
|
||||
while True:
|
||||
try:
|
||||
result = self.async_execute_adb_command(pad_code, file_name, is_check=True)
|
||||
|
|
@ -220,10 +221,10 @@ class DealAllTask:
|
|||
break
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
obj = DealAllTask()
|
||||
results = obj.async_execute_adb_command(["ACP251024MKBZTCO"], "test_abc.js", is_check=True)
|
||||
self.logger.info(type(results))
|
||||
if results:
|
||||
self.logger.info(123113)
|
||||
self.logger.info(f"1223{results}1223")
|
||||
# if __name__ == '__main__':
|
||||
# obj = DealAllTask()
|
||||
# results = obj.async_execute_adb_command(["ACP251024MKBZTCO"], "test_abc.js", is_check=True)
|
||||
# self.logger.info(type(results))
|
||||
# if results:
|
||||
# self.logger.info(123113)
|
||||
# self.logger.info(f"1223{results}1223")
|
||||
|
|
|
|||
Loading…
Reference in New Issue