trimmer

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package trimmer runs a background goroutine that periodically deletes request_logs (and cascading webhook_logs) older than the configured retention window. Keeps the free-tier Neon 0.5 GB storage cap from filling up, and bounds what pilots see in the Logs tab to the last N days of activity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, s store.Store, runEvery, retention time.Duration)

Run starts a trimmer loop on the given store. Blocks until ctx is cancelled. Call in a goroutine.

runEvery: how often to sweep. 1 hour is a good default — trimming more

often wastes cycles, less often lets storage drift longer.

retention: rows older than now()-retention are deleted. 10 days is the

default in cli/start.go.

A single initial sweep fires ~30s after Run() so a freshly-booted server doesn't wait a full hour before its first cleanup.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL