# HG changeset patch # User Drew DeVault # Date 1721987994 -7200 # Fri Jul 26 11:59:54 2024 +0200 # Node ID f9ed8ead7176e6dcf15fa91e49933b372c04da0d # Parent 65fe6167bc54e7430eb0db93172cebe0ff79cf5d API: improve precision of repository cursors Otherwise we run into a problem when a lot of resources are created within the same second-resolution Unix timestamp, such as when I just scripted a bunch of repo creation to test pagination locally. Matches a similar approach taken for git.sr.ht in ee7701a9. diff --git a/api/graph/model/repository.go b/api/graph/model/repository.go --- a/api/graph/model/repository.go +++ b/api/graph/model/repository.go @@ -122,7 +122,7 @@ if cur.Next != "" { ts, _ := strconv.ParseInt(cur.Next, 10, 64) - updated := time.Unix(ts, 0) + updated := time.UnixMicro(ts).UTC() q = q.Where(database.WithAlias(r.alias, "updated")+"<= ?", updated) } q = q.