Refactor fast-path Sync to log skip reasons, streamline tryFastPathSync outputs, and improve debug consistency.

This commit is contained in:
mlsmaycon
2026-04-24 21:25:32 +02:00
parent d3ea28734c
commit 69c0b96d73
2 changed files with 22 additions and 16 deletions

View File

@@ -354,9 +354,11 @@ func (s *Server) Sync(req *proto.EncryptedMessage, srv proto.ManagementService_S
metahash := metaHash(peerMeta, realIP.String())
s.loginFilter.addLogin(peerKey.String(), metahash)
if took, err := s.tryFastPathSync(ctx, reqStart, syncStart, accountID, peerKey, peerMeta, realIP, metahash, srv, &unlock); took {
took, skipReason, err := s.tryFastPathSync(ctx, reqStart, syncStart, accountID, peerKey, peerMeta, realIP, metahash, srv, &unlock)
if took {
return err
}
log.WithContext(ctx).Debugf("Sync (fast path) skipped reason=%s", skipReason)
peer, netMap, postureChecks, dnsFwdPort, err := s.accountManager.SyncAndMarkPeer(ctx, accountID, peerKey.String(), peerMeta, realIP, syncStart)
if err != nil {