File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,6 +203,9 @@ func (b *Backend) List(ctx context.Context, prefix string) (blobList simpleblob.
203203 combinedPrefix := b .prependGlobalPrefix (prefix )
204204
205205 if ! b .opt .UseUpdateMarker {
206+ ctx , cancel := b .clientTimeoutContext (ctx )
207+ defer cancel ()
208+
206209 return b .doList (ctx , combinedPrefix )
207210 }
208211
@@ -227,6 +230,9 @@ func (b *Backend) List(ctx context.Context, prefix string) (blobList simpleblob.
227230 return blobs .WithPrefix (prefix ), nil
228231 }
229232
233+ ctx , cancel := b .clientTimeoutContext (ctx )
234+ defer cancel ()
235+
230236 blobs , err = b .doList (ctx , b .opt .GlobalPrefix ) // We want to cache all, so no prefix
231237 if err != nil {
232238 return nil , err
@@ -249,8 +255,6 @@ func recordMinioDurationMetric(method string, start time.Time) {
249255func (b * Backend ) doList (ctx context.Context , prefix string ) (blobs simpleblob.BlobList , err error ) {
250256 metricCalls .WithLabelValues ("list" ).Inc ()
251257 metricLastCallTimestamp .WithLabelValues ("list" ).SetToCurrentTime ()
252- ctx , cancel := b .clientTimeoutContext (ctx )
253- defer cancel ()
254258 defer recordMinioDurationMetric ("list" , time .Now ())
255259
256260 // Runes to strip from blob names for GlobalPrefix
You can’t perform that action at this time.
0 commit comments