feat(api): configurable retention, housekeeping and storage overview
UPTIME_RETENTION_RAW, _HOURLY and _DAILY set TimescaleDB's retention policies, applied by "api migrate up" with owner rights and on start; periods too short for the charts are rejected. An hourly job deletes delivered notifications, stale invitations and expired API tokens after UPTIME_RETENTION_HOUSEKEEPING and resolved incidents together with the daily aggregate. The admin panel shows size, compression, retention and background job status of each storage level. Closes #63 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
057e41d5b6
commit
538e9358c3
17 files changed
+1342
-7
No files matched your search
@@ -47,6 +47,10 @@ type DB struct{ pool *pgxpool.Pool }
|
||||
// New returns a DB using pool.
|
||||
func New(pool *pgxpool.Pool) *DB { return &DB{pool: pool} }
|
||||
|
||||
// Pool returns the underlying pool for queries outside any tenant table,
|
||||
// such as TimescaleDB's catalog.
|
||||
func (d *DB) Pool() *pgxpool.Pool { return d.pool }
|
||||
|
||||
// Tx runs fn in a transaction whose row-level-security settings come from s.
|
||||
// The transaction commits if fn returns nil and rolls back otherwise.
|
||||
func (d *DB) Tx(ctx context.Context, s Scope, fn func(*store.Queries) error) error {
|
||||
|
||||
Reference in new issue
Block a user