mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
add timeout to vcsLister.List() (#1986)
This commit is contained in:
@@ -28,7 +28,7 @@ func ListHandler(dp Protocol, lggr log.Entry, df *mode.DownloadFile) http.Handle
|
||||
|
||||
versions, err := dp.List(r.Context(), mod)
|
||||
if err != nil {
|
||||
severityLevel := errors.Expect(err, errors.KindNotFound)
|
||||
severityLevel := errors.Expect(err, errors.KindNotFound, errors.KindGatewayTimeout)
|
||||
err = errors.E(op, err, severityLevel)
|
||||
lggr.SystemErr(err)
|
||||
w.WriteHeader(errors.Kind(err))
|
||||
|
||||
@@ -50,7 +50,7 @@ func getDP(t *testing.T) Protocol {
|
||||
return New(&Opts{
|
||||
Storage: s,
|
||||
Stasher: st,
|
||||
Lister: module.NewVCSLister(goBin, conf.GoBinaryEnvVars, fs),
|
||||
Lister: module.NewVCSLister(goBin, conf.GoBinaryEnvVars, fs, conf.TimeoutDuration()),
|
||||
NetworkMode: Strict,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user