fix: fix: agents container missing procps package — formula-session check_memory fails (#211)
This commit is contained in:
parent
9a1c9cc2f7
commit
c362ac1440
2 changed files with 6 additions and 1 deletions
|
|
@ -44,6 +44,11 @@ acquire_cron_lock() {
|
|||
# Exits 0 (skip) if available memory is below MIN_MB (default 2000).
|
||||
check_memory() {
|
||||
local min_mb="${1:-2000}"
|
||||
# Graceful fallback if free command is not available (procps not installed)
|
||||
if ! command -v free &>/dev/null; then
|
||||
log "run: free not found, skipping memory check"
|
||||
return 0
|
||||
fi
|
||||
local avail_mb
|
||||
avail_mb=$(free -m | awk '/Mem:/{print $7}')
|
||||
if [ "${avail_mb:-0}" -lt "$min_mb" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue