internal/frontend: fix unknown module path in ScheduleFetch
A bug is fixed that caused queue.ScheduleFetch to be called with unknown
module path when the request version was main or master.
Trust: Julie Qiu
Run-TryBot: Julie Qiu
TryBot-Result: kokoro
@@ -145,9 +145,10 @@ func (s *Server) serveUnitPage(ctx context.Context, w http.ResponseWriter, r *ht
go func() {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
defer cancel()
- log.Infof(ctx, "serveUnitPage: Scheduling %q@%q to be fetched", info.modulePath, info.requestedVersion)
- if _, err := s.queue.ScheduleFetch(ctx, info.modulePath, info.requestedVersion, "", false); err != nil {
- log.Errorf(ctx, "serveUnitPage(%q): %v", r.URL.Path, err)
+ log.Infof(ctx, "serveUnitPage: Scheduling %q@%q to be fetched", um.ModulePath, info.requestedVersion)
+ if _, err := s.queue.ScheduleFetch(ctx, um.ModulePath, info.requestedVersion, "", false); err != nil {
+ log.Errorf(ctx, "serveUnitPage(%q): scheduling fetch for %q@%q: %v",
+ r.URL.Path, um.ModulePath, info.requestedVersion, err)
}
}()
}
