fix(ci): increase idle timeout to 60min, check act_runner children
The 15min timeout was too short for Rust builds. Also checks for act_runner child processes (image pull, git clone phases) not just Docker containers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,12 +63,23 @@ write_files:
|
||||
IDLE_FILE="/tmp/ci-idle-since"
|
||||
TIMEOUT_SEC=$((${idle_timeout_minutes} * 60))
|
||||
|
||||
RUNNING=$(docker ps -q --filter "name=GITEA-ACTIONS" 2>/dev/null | wc -l)
|
||||
if [ "$RUNNING" -gt 0 ]; then
|
||||
# Check for running Docker containers
|
||||
CONTAINERS=$(docker ps -q 2>/dev/null | wc -l)
|
||||
if [ "$CONTAINERS" -gt 0 ]; then
|
||||
rm -f "$IDLE_FILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if act_runner has child processes (actively running a job)
|
||||
RUNNER_PID=$(pgrep -f 'act_runner daemon' 2>/dev/null)
|
||||
if [ -n "$RUNNER_PID" ]; then
|
||||
CHILDREN=$(pgrep -P "$RUNNER_PID" 2>/dev/null | wc -l)
|
||||
if [ "$CHILDREN" -gt 0 ]; then
|
||||
rm -f "$IDLE_FILE"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# No jobs running — record when idle started
|
||||
if [ ! -f "$IDLE_FILE" ]; then
|
||||
date +%s > "$IDLE_FILE"
|
||||
|
||||
@@ -65,7 +65,7 @@ variable "runner_capacity" {
|
||||
variable "idle_timeout_minutes" {
|
||||
description = "Minutes idle before auto-shutdown (0 = disabled)"
|
||||
type = number
|
||||
default = 15
|
||||
default = 60
|
||||
}
|
||||
|
||||
variable "gitea_tailscale_host" {
|
||||
|
||||
Reference in New Issue
Block a user