[feature] 更新log相关
This commit is contained in:
@@ -52,7 +52,7 @@ class CommandProcessor:
|
||||
# cp.Command("command")
|
||||
# cp.RetryCommand("command",retry_time:int)
|
||||
# asyncio.run(cp.AsyncCommand("command","stop track regex"))
|
||||
script_dir = os.path.dirname((os.path.abspath(__file__)))
|
||||
# script_dir = os.path.dirname((os.path.abspath(__file__)))
|
||||
cp = CommandProcessor()
|
||||
haveError = False
|
||||
def TaskFailRetry(command:str)->int:
|
||||
@@ -75,6 +75,7 @@ cp.Command("maa self update")
|
||||
cp.Command("docker stop redroid")
|
||||
redroid_path = os.getenv('redroid_path', "/home/lichx/.config/redroid-rk3588/")
|
||||
adb_address = os.getenv('adb_address', "localhost:5555")
|
||||
log_dir = os.getenv('MAA_LOG', "/home/lichx/.config/redroid-rk3588/log/")
|
||||
os.chdir(redroid_path)
|
||||
cp.Command("docker compose up -d")
|
||||
time.sleep(15)
|
||||
@@ -89,7 +90,7 @@ haveError |= TaskFailRetry("maa run mall") != 0
|
||||
haveError |= TaskFailRetry("maa run award") != 0
|
||||
# storage error log
|
||||
if haveError:
|
||||
cp.Command(f"cp {script_dir}/pyshell.log {script_dir}/pyshell.{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}.log")
|
||||
cp.Command(f"cp {log_dir}/pyshell.log {log_dir}/pyshell.{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}.log")
|
||||
# shutdown
|
||||
cp.RetryCommand("maa closedown")
|
||||
cp.Command("docker stop redroid")
|
||||
|
||||
Reference in New Issue
Block a user