add timeout to vcsLister.List() (#1986)

This commit is contained in:
Taylor Chen
2024-09-19 23:19:47 -07:00
committed by GitHub
parent 6f1346fdb9
commit 3856c6feee
5 changed files with 16 additions and 5 deletions
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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,
})
}