refactor: merge retry target type into http (max_retries=0 = fire-and-forget)
All checks were successful
check / check (push) Successful in 1m46s

This commit is contained in:
clawbot
2026-03-01 23:51:55 -08:00
parent 4dd4dfa5eb
commit 25e27cc57f
7 changed files with 150 additions and 105 deletions

View File

@@ -92,6 +92,16 @@ func (d *Database) migrate() error {
}
d.log.Info("database migrations completed")
// Data migration: merge "retry" target type into "http".
// Previously there were two separate HTTP-based target types: "http"
// (fire-and-forget) and "retry" (with retries). Now "http" handles
// both: max_retries=0 means fire-and-forget, max_retries>0 enables
// retries with exponential backoff and circuit breaker.
if err := d.db.Exec("UPDATE targets SET type = 'http' WHERE type = 'retry'").Error; err != nil {
d.log.Error("failed to migrate retry targets to http", "error", err)
return err
}
// Check if admin user exists
var userCount int64
if err := d.db.Model(&User{}).Count(&userCount).Error; err != nil {