refactor(api): stop running reconciler inside API

This commit is contained in:
Голиков Maximillian Антон
2026-11-14 20:01:17 +03:00
parent 79dfa6c300
commit 505410001e
3 changed files with 24 additions and 24 deletions
+14 -14
View File
@@ -134,21 +134,21 @@ func main() {
srv := &http.Server{Addr: addr, Handler: router}
reconcilerCtx, reconcilerCancel := context.WithCancel(context.Background())
defer reconcilerCancel()
if cfg.ReconcilerEnabled {
reconciler := service.NewReconciler(
store.Attachments(),
objectStorage,
store.Outbox(),
pool,
cfg.ReconcilerGracePeriod,
)
go reconciler.Run(reconcilerCtx, cfg.ReconcilerInterval)
}
// reconcilerCtx, reconcilerCancel := context.WithCancel(context.Background())
// defer reconcilerCancel()
// if cfg.ReconcilerEnabled {
// reconciler := service.NewReconciler(
// store.Attachments(),
// objectStorage,
// store.Outbox(),
// pool,
// cfg.ReconcilerGracePeriod,
// )
// go reconciler.Run(reconcilerCtx, cfg.ReconcilerInterval)
// }
go func() {
log.Printf("Запускаем на %s (SESSION_STORE=%s, RECONCILER_ENABLED=%v)", addr, cfg.SessionStore, cfg.ReconcilerEnabled)
log.Printf("Запускаем на %s (SESSION_STORE=%s, RECONCILER_ENABLED=%v)", addr, cfg.SessionStore)
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatalf("Ошибка запуска: %v", err)
}
@@ -162,7 +162,7 @@ func main() {
ready.Store(false)
outboxCancel()
reconcilerCancel()
// reconcilerCancel()
if cfg.ShutdownDrain > 0 {
time.Sleep(cfg.ShutdownDrain)