Skip to content

Commit

Permalink
decrease goroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
RekGRpth committed Sep 24, 2024
1 parent a90bcc3 commit a601ba8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions restore/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func restoreDataFromTimestamp(fpInfo filepath.FilePathInfo, dataEntries []toc.Co
return 0
}

initialPipes := connectionPool.NumConns
origSize, destSize, resizeCluster, batches := GetResizeClusterInfo()
if backupConfig.SingleDataFile || resizeCluster {
msg := ""
Expand All @@ -228,7 +229,7 @@ func restoreDataFromTimestamp(fpInfo filepath.FilePathInfo, dataEntries []toc.Co
}

utils.WriteOidListToSegments(oidList, globalCluster, fpInfo, "oid")
initialPipes := CreateInitialSegmentPipes(oidList, globalCluster, connectionPool, fpInfo)
initialPipes = CreateInitialSegmentPipes(oidList, globalCluster, connectionPool, fpInfo)
if wasTerminated {
return 0
}
Expand Down Expand Up @@ -262,7 +263,7 @@ func restoreDataFromTimestamp(fpInfo filepath.FilePathInfo, dataEntries []toc.Co
utils.StartHelperChecker(globalCluster, globalFPInfo, cancel)
}

for i := 0; i < connectionPool.NumConns; i++ {
for i := 0; i < initialPipes; i++ {
workerPool.Add(1)
go func(whichConn int) {
defer func() {
Expand Down

0 comments on commit a601ba8

Please sign in to comment.