[ server ] [ executor ]- shell executor optimize - 1

This commit is contained in:
zeaslity
2023-02-06 17:22:02 +08:00
parent f347cedce3
commit f4e636a368
4 changed files with 63 additions and 8 deletions

View File

@@ -6,6 +6,13 @@ start_time=$(date +%s)
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [[ $(ps -ef | grep -v "color" |grep -c "/octopus-agent/shell/function/load50cpu_2_hour") -gt 0 ]]; then
log "已经存在CPU占用进程 !杀死该进程"
kill -9 $(ps -ef | grep -v "color" |grep "/octopus-agent/shell/function/load50cpu_2_hour" | awk '{print$2}')
fi
log "开始执行CPU占用任务占用时间为 2小时"
while [ $elapsed_time -lt 7200 ]
do