INNER CODE UNIT · Shell
CUTOFF
okx/agent-skills · skills/earn-hunter/scripts/scan.sh:785
CUTOFF=$(( NOW_EPOCH - TTL_DAYS * 86400 ))
tmp=$(jq --argjson cutoff "$CUTOFF" '
def keep(e):
( e.notifiedAt // "" ) as $ts
| if $ts=="" then true
else ( ($ts | sub("\\+.*$";"Z") | sub("Z$";"Z") | try (fromdateiso8601) catch null) ) as $ep
| if $ep==null then true else ($ep >= $cutoff) end
end;
.flash = (.flash | with_entries(select(keep(.value))))
| .fixed = (.fixed | with_entries(select(keep(.value))))
| .flexible = (.flexible | with_entries(select(keep(.value))))
' "$STATE_FILE" 2>/dev/null)
[[ -n "$tmp" ]] && printf '%s\n' "$tmp" > "$STATE_FILE"
# ---- Step 6d: success ----
mark_success
# ---- Step 7: verboseLog gate when no new opportunities ----