(lom *cluster.LOM)
| 219 | } |
| 220 | |
| 221 | func (t *singleObjectTask) downloadRemote(lom *cluster.LOM) error { |
| 222 | // Set custom context values (used by `ais/backend/*`). |
| 223 | ctx, cancel := context.WithTimeout(t.downloadCtx, t.initialTimeout()) |
| 224 | defer cancel() |
| 225 | wrapReader := func(r io.ReadCloser) io.ReadCloser { return t.wrapReader(ctx, r) } |
| 226 | ctx = context.WithValue(ctx, cos.CtxReadWrapper, cos.ReadWrapperFunc(wrapReader)) |
| 227 | ctx = context.WithValue(ctx, cos.CtxSetSize, cos.SetSizeFunc(t.setTotalSize)) |
| 228 | |
| 229 | // Do final GET (prefetch) request. |
| 230 | _, err := t.parent.t.GetCold(ctx, lom, cmn.OwtGetTryLock) |
| 231 | return err |
| 232 | } |
| 233 | |
| 234 | func (t *singleObjectTask) initialTimeout() time.Duration { |
| 235 | config := cmn.GCO.Get() |
no test coverage detected