feat: enable configured multitable synchronization

This commit is contained in:
Eric 1549169735@qq.com
2026-08-19 22:19:51 +08:00
parent 1e3434d76e
commit 11ae6761ad
5 changed files with 51 additions and 38 deletions

View File

@@ -2,6 +2,7 @@ package multitable
import (
"context"
"errors"
"fmt"
"time"
@@ -75,7 +76,9 @@ func (w *Worker) claim() []model.MultiTableOutbox {
func (w *Worker) retry(event model.MultiTableOutbox, cause error) {
status := "pending"
availableAt := time.Now().Add(backoff(event.Attempts))
if event.Attempts >= w.config.MaxAttempts {
// A missing source row cannot be repaired by retrying. This commonly occurs
// for audit events created before a source record was deleted.
if errors.Is(cause, gorm.ErrRecordNotFound) || event.Attempts >= w.config.MaxAttempts {
status = "failed"
}
message := truncate(cause.Error(), 1024)