chore(v2): 终审收尾——settle-sync 非常态结果落日志 + Retry 补 body 上限
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
This commit is contained in:
@@ -3,6 +3,7 @@ package gateway
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/wangjia/pay/internal/model"
|
||||
@@ -131,8 +132,14 @@ func (g *Gateway) SyncPendingAttempts(ctx context.Context, limit int) (int, erro
|
||||
if err != nil || ev == nil {
|
||||
continue
|
||||
}
|
||||
if res, _ := g.Settle(ctx, ev); res == SettleProcessed {
|
||||
res, serr := g.Settle(ctx, ev)
|
||||
switch res {
|
||||
case SettleProcessed:
|
||||
settled++
|
||||
case SettleIgnored, SettleDuplicate:
|
||||
// 常态:未付/已处理,不刷日志
|
||||
default: // not_found / amount_mismatch / failed —— 对账兜底的盲区,必须可见
|
||||
log.Printf("[settle-sync] attempt=%s channel=%s result=%s err=%v", att.ProviderRef, att.Channel, res, serr)
|
||||
}
|
||||
}
|
||||
return settled, nil
|
||||
|
||||
Reference in New Issue
Block a user