mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-01 21:30:21 +00:00
fix(e2e): use aggressive cleanup threshold (5 min) for pre-run to prevent quota exhaustion (#2798)
The pre-run stale cleanup (added in #2789) used the same 30-minute max_age as the post-run cleanup. Orphaned instances from recently-failed runs (< 30 min old) were not cleaned, causing quota exhaustion on DigitalOcean and other clouds. Pre-run cleanup now uses _CLEANUP_MAX_AGE=300 (5 min) to aggressively reclaim orphaned e2e instances before provisioning new ones. Post-run cleanup retains the 30-minute default. All 5 cloud drivers respect the override. Fixes #2793 Agent: code-health Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e4bfd38443
commit
8fef58845c
6 changed files with 9 additions and 9 deletions
|
|
@ -212,7 +212,7 @@ _aws_cleanup_stale() {
|
|||
local region="${AWS_REGION:-us-east-1}"
|
||||
local now
|
||||
now=$(date +%s)
|
||||
local max_age=1800 # 30 minutes in seconds
|
||||
local max_age="${_CLEANUP_MAX_AGE:-1800}" # default 30 min; pre-run uses shorter
|
||||
|
||||
# List all instances
|
||||
local instances_json
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ _digitalocean_cleanup_stale() {
|
|||
|
||||
local now
|
||||
now=$(date +%s)
|
||||
local max_age=1800 # 30 minutes in seconds
|
||||
local max_age="${_CLEANUP_MAX_AGE:-1800}" # default 30 min; pre-run uses shorter
|
||||
|
||||
local droplets_json
|
||||
droplets_json=$(_do_curl_auth -sf \
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ _gcp_cleanup_stale() {
|
|||
local project="${GCP_PROJECT:-}"
|
||||
local now
|
||||
now=$(date +%s)
|
||||
local max_age=1800 # 30 minutes in seconds
|
||||
local max_age="${_CLEANUP_MAX_AGE:-1800}" # default 30 min; pre-run uses shorter
|
||||
|
||||
if [ -z "${project}" ]; then
|
||||
log_warn "GCP_PROJECT not set — skipping stale cleanup"
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ _hetzner_teardown() {
|
|||
_hetzner_cleanup_stale() {
|
||||
local now
|
||||
now=$(date +%s)
|
||||
local max_age=1800 # 30 minutes
|
||||
local max_age="${_CLEANUP_MAX_AGE:-1800}" # default 30 min; pre-run uses shorter
|
||||
|
||||
local response
|
||||
response=$(_hetzner_curl_auth -sf \
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ _sprite_teardown() {
|
|||
_sprite_cleanup_stale() {
|
||||
local now
|
||||
now=$(date +%s)
|
||||
local max_age=1800 # 30 minutes in seconds
|
||||
local max_age="${_CLEANUP_MAX_AGE:-1800}" # default 30 min; pre-run uses shorter
|
||||
|
||||
# List all sprites
|
||||
local sprite_output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue