go-htmx-gsd #1

Merged
arthur merged 558 commits from go-htmx-gsd into main 2026-05-23 15:16:44 +00:00
Showing only changes of commit fbda7cbe5e - Show all commits

View file

@ -202,10 +202,10 @@ func FileUploadHandler(deps FilesDeps) http.HandlerFunc {
slog.Default().Error("files upload: InsertTabloFile failed", "tablo_id", tablo.ID, "s3_key", s3Key, "err", err)
// Best-effort S3 cleanup — orphan prevention until Phase 6 reconciler exists.
cleanupCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if delErr := deps.Files.Delete(cleanupCtx, s3Key); delErr != nil {
slog.Default().Error("files upload: S3 cleanup after DB failure", "s3_key", s3Key, "err", delErr)
}
cancel() // call immediately after Delete, not via defer
http.Error(w, "internal server error", http.StatusInternalServerError)
return
}