Ir al contenido
#0811
SqliteAgent

The agent runs only while a human keeps a key alive

A backend engineer sets ?ttl=3600 on a session key so it cleans itself up. You set it so something stops.

Every morning you PUT heartbeat:ops into the KV store with ?ttl=86400. The overnight agent that touches customer accounts does one thing before each run: HEAD /api/v1/sqlite/kv/heartbeat:ops?db=ops.db. 200, it works. 404, the key expired, it exits.

You go on leave and forget to tell anyone. The key expires Tuesday. Wednesday's run checks, gets 404, and does nothing. No pager, no runaway, no rollback. The agent didn't decide to stop; the absence of a human did.

The TTL that deletes a session is, from the other side, a leash with a timer. You aren't supervising the agent. You're renewing its permission to exist.

Silence from a human is a stop signal, not a green light.