Documentation
¶
Overview ¶
Package cleanup provides background goroutines that:
- Stop containers for sessions idle beyond the configured timeout.
- Purge audit log entries older than the configured retention window.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReconcileOrphans ¶ added in v0.4.1
func ReconcileOrphans(ctx context.Context, db *sqlx.DB, docker *dockerpkg.Client, al *audit.Logger, ws *workspace.Manager)
ReconcileOrphans closes active sessions whose container no longer exists, for example after `make down` removed the sandboxes or an operator ran `docker rm`. Without it they stay listed as running, count against the actor's quota, and every command on them fails. Sessions are only closed when Docker answers "not found"; any other error leaves them alone.
func Start ¶
func Start(ctx context.Context, db *sqlx.DB, docker *dockerpkg.Client, al *audit.Logger, ws *workspace.Manager, interval, idleFor time.Duration, retentionDays int)
Start launches the idle-session cleanup loop. It runs until ctx is cancelled. interval controls how frequently the sweep runs; idleFor is how long a session must have been quiet before its session is stopped. Stopping is final (there is no restart), so the session's workspace directory is removed with it.
When retentionDays > 0, audit logs older than that many days are also pruned on every sweep. Set to 0 to retain audit logs indefinitely.
Types ¶
This section is empty.