add timeout to context
This commit is contained in:
parent
6139c6adbb
commit
3b91a57bc1
|
@ -97,7 +97,9 @@ func (p *processor) splitMajorTask(taskItem *task.Task) error {
|
|||
|
||||
var sourceTotalDocs int64
|
||||
var targetTotalDocs int64
|
||||
ctx := context.Background()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second*60))
|
||||
defer cancel()
|
||||
|
||||
for i, index := range clusterComparisonTask.Indices {
|
||||
sourceDump := migration_model.IndexComparisonDumpConfig{
|
||||
|
|
|
@ -96,7 +96,9 @@ func (p *processor) splitMajorMigrationTask(taskItem *task.Task) error {
|
|||
pids = append(pids, taskItem.ID)
|
||||
|
||||
var totalDocs int64
|
||||
ctx := context.Background()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second*60))
|
||||
defer cancel()
|
||||
|
||||
for i, index := range clusterMigrationTask.Indices {
|
||||
source := migration_model.IndexMigrationSourceConfig{
|
||||
|
|
Loading…
Reference in New Issue