Repository navigation
Commit 2e40e70
Sweep orphaned Xata branches in the cleanup cron
The nightly cleanup only deleted branches still tracked by a userBranch
row. Branches orphaned in Xata — delete failures swallowed on the user
path after the row was removed, or a crash between createBranch and the
row insert — were never revisited and lingered indefinitely.
Add an orphan sweep to cleanupIdleBranches: delete any branch that is
not the parent (main), not a tpl-* template, and not referenced by a
userBranch row, with a one-hour createdAt grace period so an in-flight
create is never swept mid-provisioning.
Also make the manual scripts/xata-cleanup.ts keep tpl-* templates
instead of deleting everything except main.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent f1857f1 commit 2e40e70
2 files changed
Lines changed: 66 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| 477 | + | |
477 | 478 | | |
478 | 479 | | |
479 | 480 | | |
| |||
519 | 520 | | |
520 | 521 | | |
521 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
522 | 569 | | |
523 | 570 | | |
524 | | - | |
525 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
526 | 574 | | |
527 | 575 | | |
528 | 576 | | |
| |||
538 | 586 | | |
539 | 587 | | |
540 | 588 | | |
| 589 | + | |
541 | 590 | | |
542 | 591 | | |
543 | 592 | | |
| |||
570 | 619 | | |
571 | 620 | | |
572 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
573 | 631 | | |
574 | 632 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
77 | | - | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
0 commit comments