feat(deploy): 在线更新 - 新增后台检查、强制备份迁移与失败自动回退

This commit is contained in:
ddCat committed 2026-08-30 22:15:17 +08:00
1 parent 8227921c68
commit 694cb974fb
60 files changed
+4124 -93

No files matched your search

+12 -6
View File
@@ -1,6 +1,7 @@
package service
import (
"context"
"log"
"time"
)
@@ -25,18 +26,23 @@ func (s *Service) AuditBillingReview() error {
return nil
}
func (s *Service) startBillingReviewAudit() {
func (s *Service) startBillingReviewAudit(ctx context.Context) {
audit := func() {
if err := s.AuditBillingReview(); err != nil {
log.Printf("billing review audit failed: %v", err)
}
}
audit()
go func() {
s.runWorkerLoop(func(ctx context.Context) {
audit()
ticker := time.NewTicker(time.Hour)
defer ticker.Stop()
for range ticker.C {
audit()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
audit()
}
}
}()
})
}