internal/index: format to nanoseconds for index URL. The golang index supports both: - https://index.golang.org/index?since=2019-04-10T20:30:42Z&limit=3 - https://index.golang.org/index?since=2019-04-10T20:30:42.400000Z&limit=3 And notably returns different results. That's because between the 42s mark and the 43s mark, new modules got indexed. So, at second granularity, you need your cursor's window size to be big enough to capture everything that changed in that second, or else risk missing modules OR not making progress beyond that second. The higher your precision, the less things can fit in the window, meaning that the cursor has a higher change to make progress / not lose anything. So, this change makes us use the highest precision available (second -> nano). Note that since postgres only has microsecond granularity we're actually going to be querying at microsecond granularity, but anyways, that's just a semantic detail as far as this change is concerned. We still get higher precision. (This change was inspired by our debugging cursor progress issues against our internal golang-index https://github.com/netflix-skunkworks/golang-index). Change-Id: I32d410214a104a8d694ec6edf9cba4a94c579f41 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/803623 Reviewed-by: Carlos Amedee <carlos@golang.org> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com>
diff --git a/internal/index/index.go b/internal/index/index.go index f331d75..33a408c 100644 --- a/internal/index/index.go +++ b/internal/index/index.go
@@ -43,7 +43,7 @@ func (c *Client) pollURL(since time.Time, limit int) string { values := url.Values{} - values.Set("since", since.Format(time.RFC3339)) + values.Set("since", since.Format(time.RFC3339Nano)) if limit > 0 { values.Set("limit", strconv.Itoa(limit)) }