mirror of
https://github.com/minio/minio.git
synced 2025-04-01 10:13:42 -04:00
fix: replace context by timeout-context from parent-context when selfSpeedTest
(#17906)
This commit is contained in:
parent
124e28578c
commit
6aeca54ece
@ -85,14 +85,9 @@ func selfSpeedTest(ctx context.Context, opts speedTestOpts) (SpeedTestResult, er
|
|||||||
|
|
||||||
objCountPerThread := make([]uint64, opts.concurrency)
|
objCountPerThread := make([]uint64, opts.concurrency)
|
||||||
|
|
||||||
uploadsCtx, uploadsCancel := context.WithCancel(context.Background())
|
uploadsCtx, uploadsCancel := context.WithTimeout(ctx, opts.duration)
|
||||||
defer uploadsCancel()
|
defer uploadsCancel()
|
||||||
|
|
||||||
go func() {
|
|
||||||
time.Sleep(opts.duration)
|
|
||||||
uploadsCancel()
|
|
||||||
}()
|
|
||||||
|
|
||||||
objNamePrefix := pathJoin(speedTest, mustGetUUID())
|
objNamePrefix := pathJoin(speedTest, mustGetUUID())
|
||||||
|
|
||||||
userMetadata := make(map[string]string)
|
userMetadata := make(map[string]string)
|
||||||
@ -144,12 +139,8 @@ func selfSpeedTest(ctx context.Context, opts speedTestOpts) (SpeedTestResult, er
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadsCtx, downloadsCancel := context.WithCancel(context.Background())
|
downloadsCtx, downloadsCancel := context.WithTimeout(ctx, opts.duration)
|
||||||
defer downloadsCancel()
|
defer downloadsCancel()
|
||||||
go func() {
|
|
||||||
time.Sleep(opts.duration)
|
|
||||||
downloadsCancel()
|
|
||||||
}()
|
|
||||||
|
|
||||||
gopts := minio.GetObjectOptions{}
|
gopts := minio.GetObjectOptions{}
|
||||||
gopts.Set(globalObjectPerfUserMetadata, "true") // Bypass S3 API freeze
|
gopts.Set(globalObjectPerfUserMetadata, "true") // Bypass S3 API freeze
|
||||||
|
Loading…
x
Reference in New Issue
Block a user