this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

drop stale account commits early

+10
+10
cmd/relay/relay/ingest.go
··· 127 127 logger.Error("failed to read previous repo state", "err", err) 128 128 } 129 129 130 + // fast check for stale revision (will be re-checked in VerifyRepoCommit) 131 + if prevRepo != nil && prevRepo.Rev != "" && evt.Rev != "" { 132 + if evt.Rev <= prevRepo.Rev { 133 + logger.Warn("dropping commit with old rev", "prevRev", prevRepo.Rev) 134 + return nil 135 + } 136 + } 137 + 130 138 // most commit validation happens in this method. Note that is handles lenient/strict modes. 131 139 newRepo, err := r.VerifyRepoCommit(ctx, evt, ident, prevRepo, hostname) 132 140 if err != nil { ··· 170 178 if ident == nil { 171 179 // TODO: what to do if identity resolution fails 172 180 } 181 + 182 + // TODO: should we load account 'rev' here and prevent roll-backs? or allow roll-backs? 173 183 174 184 newRepo, err := r.VerifyRepoSync(ctx, evt, ident, hostname) 175 185 if err != nil {