This commit is contained in:
parent
a608d4af29
commit
7b202ee67c
|
@ -54,11 +54,17 @@ class S:
|
||||||
local_path = arr[len(arr) - 1] + ".jpeg"
|
local_path = arr[len(arr) - 1] + ".jpeg"
|
||||||
del_images.append(local_path)
|
del_images.append(local_path)
|
||||||
|
|
||||||
|
ret_save_status = 0
|
||||||
|
try:
|
||||||
ret_save = self.heic_to_jpg_and_save(old_key, local_path)
|
ret_save = self.heic_to_jpg_and_save(old_key, local_path)
|
||||||
ret_save_status = ret_save.resp.status
|
ret_save_status = ret_save.resp.status
|
||||||
if ret_save_status != 200:
|
if ret_save_status != 200:
|
||||||
logger.Info("heic_to_jpg_and_save fail, old_key: {}, ret: {}".format(old_key, ret_save_status))
|
logger.Info("heic_to_jpg_and_save fail, old_key: {}, ret: {}".format(old_key, ret_save_status))
|
||||||
continue
|
continue
|
||||||
|
except Exception as e:
|
||||||
|
logger.Info("panic: {}".format(str(e)))
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
# 上传oss
|
# 上传oss
|
||||||
ret_upload = self.upload_img_to_oss(local_path, new_key)
|
ret_upload = self.upload_img_to_oss(local_path, new_key)
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
from lib.all import *
|
||||||
|
|
||||||
|
while True:
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
res = requests.get("https://testapi.tiefen.fun/test/ip", {})
|
||||||
|
print(res.text)
|
|
@ -0,0 +1,38 @@
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
duration = 10 * 6000 # 总持续时间,单位为秒
|
||||||
|
interval = 1 # 循环间隔,单位为秒
|
||||||
|
iterations = duration // interval # 循环次数
|
||||||
|
server_status_fd_path = "/Users/erwin/SERVER_STATUS_FD"
|
||||||
|
|
||||||
|
if not os.path.exists(server_status_fd_path):
|
||||||
|
try:
|
||||||
|
with open(server_status_fd_path, "w") as f:
|
||||||
|
print("文件已创建")
|
||||||
|
f.close()
|
||||||
|
except Exception as e:
|
||||||
|
print(str(e))
|
||||||
|
|
||||||
|
try:
|
||||||
|
subprocess.run("kill -2 59638", shell=True)
|
||||||
|
except Exception as e:
|
||||||
|
print(str(e))
|
||||||
|
|
||||||
|
# 循环执行
|
||||||
|
for i in range(iterations):
|
||||||
|
time.sleep(interval)
|
||||||
|
print("执行代码,当前循环次数:", i + 1)
|
||||||
|
try:
|
||||||
|
with open(server_status_fd_path, "r") as f:
|
||||||
|
var = f.read().replace("\r", "").replace("\n", "").replace("\t", "")
|
||||||
|
if var == "STOP" or var == "":
|
||||||
|
subprocess.run("nohup /Users/erwin/wishpalv2/service/app/mix/cmd_local/cmd_local &", shell=True)
|
||||||
|
f.close()
|
||||||
|
break
|
||||||
|
f.close()
|
||||||
|
except Exception as e:
|
||||||
|
print(str(e))
|
||||||
|
|
||||||
|
# time.sleep(interval) # 等待指定的间隔时间
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
duration=$((30)) # 总持续时间,单位为秒
|
||||||
|
interval=1 # 循环间隔,单位为秒
|
||||||
|
iterations=$((duration / interval)) # 循环次数
|
||||||
|
server_status_fd_path="/app/SERVER_STATUS_FD"
|
||||||
|
|
||||||
|
if [ ! -f "$server_status_fd_path" ]; then
|
||||||
|
touch "$server_status_fd_path"
|
||||||
|
echo "文件已创建"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
pid=$(ps -ef | grep wishpal-ironfan | grep -v grep | awk -F " " '{print $2}')
|
||||||
|
echo $pid
|
||||||
|
kill -2 $pid
|
||||||
|
|
||||||
|
systemctl stop wishpal-ironfan
|
||||||
|
|
||||||
|
# 循环执行
|
||||||
|
for ((i=0; i<iterations; i++)); do
|
||||||
|
echo "执行代码,当前循环次数: $((i + 1))"
|
||||||
|
if [ -f "$server_status_fd_path" ]; then
|
||||||
|
var=$(cat "$server_status_fd_path" | tr -d '\r\n\t')
|
||||||
|
echo $var
|
||||||
|
if [ "$var" = "STOP" ] || [ -z "$var" ]; then
|
||||||
|
systemctl start wishpal-ironfan
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep $interval # 等待指定的间隔时间
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue