mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 18:37:26 +08:00
resolve memory issue with commit
This commit is contained in:
parent
3cd7c2bb27
commit
1024bbada5
@ -103,7 +103,11 @@ func (n *LazyVectorCommitmentBranchNode) Commit(
|
||||
if n.Commitment == nil || recalculate {
|
||||
vector := make([][]byte, len(n.Children))
|
||||
wg := sync.WaitGroup{}
|
||||
throttle := make(chan struct{}, runtime.WorkerCount(0, false))
|
||||
workers := 1
|
||||
if n.LongestBranch == 2 {
|
||||
workers = runtime.WorkerCount(0, false)
|
||||
}
|
||||
throttle := make(chan struct{}, workers)
|
||||
for i, child := range n.Children {
|
||||
throttle <- struct{}{}
|
||||
wg.Add(1)
|
||||
|
||||
@ -67,6 +67,7 @@ func TestLoadHypergraphFallback(t *testing.T) {
|
||||
}
|
||||
for k, a := range clientLoad.GetVertexAdds() {
|
||||
assert.Equal(t, len(crypto.ConvertAllPreloadedLeaves(string(application.VertexAtomType), string(application.AddsPhaseType), k, clientHypergraphStore, a.GetTree().Root, []int{})), 100000)
|
||||
fmt.Printf("%x\n", a.GetTree().Commit(true))
|
||||
}
|
||||
|
||||
fmt.Println("Should not reattempt")
|
||||
@ -75,6 +76,7 @@ func TestLoadHypergraphFallback(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
clientLoad, err = clientHypergraphStore.LoadHypergraph()
|
||||
assert.NoError(t, err)
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
func TestHypergraphSyncServer(t *testing.T) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user