delete old tab bundles before making new ones

This commit is contained in:
Joe Lothan 2026-05-18 00:49:50 -04:00
parent a977a8c0b3
commit 21f2a75ed3
2 changed files with 43 additions and 1 deletions

View file

@ -131,8 +131,16 @@ func main() {
}
wg.Wait()
// Clean old bundles before writing new ones (avoids orphans if count changed)
if !cfg.DryRun {
fmt.Println("\nCleaning old bundles from S3...")
if err := s3DeletePrefix(ctx, cfg.SiteBucket, "tabs/"); err != nil {
log.Fatalf("Failed to clean old bundles: %v", err)
}
}
// Chunk into bundles and write
fmt.Println("\nWriting bundles...")
fmt.Println("Writing bundles...")
bundleCount := 0
var totalBytes int64