From bb6da5216eba144f9891c1c0dd2228fdbfa45163 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Wed, 1 Sep 2021 07:22:46 -0400 Subject: internal/{worker/fetch}: include DB activity in load-shedding Move the load-shedding logic to the worker and have it span both the fetch and processing of the module (as previously) as well as inserting it into the database. This is a more accurate estimation of load, since running a lot of concurrent queries definitely slows down processing. Most of the time this won't make much difference, but under high load, such as when processing multiple large modules, it will reduce DB contention and should result in greater throughput. For golang/go#48010 Change-Id: I7d0922e02d00182e867fd3b29fc284c32ecab5ee Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/346749 Trust: Jonathan Amsterdam Run-TryBot: Jonathan Amsterdam TryBot-Result: kokoro Reviewed-by: Julie Qiu --- internal/fetchdatasource/fetchdatasource.go | 1 - 1 file changed, 1 deletion(-) (limited to 'internal/fetchdatasource/fetchdatasource.go') diff --git a/internal/fetchdatasource/fetchdatasource.go b/internal/fetchdatasource/fetchdatasource.go index 84b44c17..e7e38c48 100644 --- a/internal/fetchdatasource/fetchdatasource.go +++ b/internal/fetchdatasource/fetchdatasource.go @@ -128,7 +128,6 @@ func (ds *FetchDataSource) fetch(ctx context.Context, modulePath, version string }() for _, g := range ds.opts.Getters { fr := fetch.FetchModule(ctx, modulePath, version, g, ds.opts.SourceClient) - defer fr.Defer() if fr.Error == nil { m := fr.Module if ds.opts.BypassLicenseCheck { -- cgit v1.3