internal/worker: relax check for read works states quota error
The error keeps happning, but the server never actually sleeps a min:
the message that the server is about to sleep cannot be located in the
logs.
Change-Id: Icec2ad4937bc782e8d26088240c8b92cd91a0c75
Reviewed-on: https://go-review.googlesource.com/c/pkgsite-metrics/+/501310
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
diff --git a/internal/worker/govulncheck.go b/internal/worker/govulncheck.go
index 8c15ce4..9d9d066 100644
--- a/internal/worker/govulncheck.go
+++ b/internal/worker/govulncheck.go
@@ -10,7 +10,6 @@
"errors"
"os"
"path/filepath"
- "strings"
"time"
"golang.org/x/pkgsite-metrics/internal"
@@ -56,12 +55,7 @@
return false
}
// BigQuery uses 403 for quota exceeded.
- if gerr.Code != 403 {
- return false
- }
- // Further validate that this is a quota issue with ReadWorkStates.
- emsg := gerr.Error()
- return strings.Contains(emsg, "ReadWorkStates") && strings.Contains(emsg, "quota")
+ return gerr.Code == 403
}
func (h *GovulncheckServer) getWorkVersion(ctx context.Context) (_ *govulncheck.WorkVersion, err error) {