feat(server): reap Free instances whose licence lapsed

The control plane owns deletion because it is the only service that knows
what an instance is made of; mirroring that collection list into admin
would drift, and a drift here deletes the wrong rows.

Defaults OFF. Eligibility is three positive assertions — Free tier, an
expiry that exists, and an expiry past the window — so a missing or stale
field is never eligible. The instance document is deleted last, making an
interrupted purge retryable rather than orphaning rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
mrhid6
2026-07-26 13:23:37 +01:00
co-authored by Claude Opus 5
parent 372a8c5ddf
commit 4e90e8619f
2 changed files with 200 additions and 0 deletions
+2
View File
@@ -113,6 +113,8 @@ func main() {
monitorsched.Start(context.Background())
services.StartReaper(context.Background())
r := gin.New()
r.Use(gin.Recovery())
r.Use(gin.LoggerWithConfig(gin.LoggerConfig{SkipPaths: []string{"/api/console/tunnel"}}))