switch to using unbuffered channel for queued requests

This commit is contained in:
Cassandra Heart 2025-02-15 03:33:14 -06:00
parent 24282dd690
commit 1100fcadd6
No known key found for this signature in database
GPG Key ID: 6352152859385958

View File

@ -321,8 +321,10 @@ func syncTreeBidirectionallyServer(
return err
}
pendingQueries := make(chan []int32, 10000)
pendingQueries <- rootPath
pendingQueries := make(chan []int32)
go func(path []int32) {
pendingQueries <- path
}(rootPath)
incoming := make(chan *protobufs.HypergraphComparison, 10000)
go func() {
@ -458,7 +460,9 @@ func syncTreeBidirectionallyServer(
append([]int32(nil), remoteInfo.Path...),
remoteChild.Index,
)
pendingQueries <- newPath
go func(path []int32) {
pendingQueries <- path
}(newPath)
}
}
}
@ -604,8 +608,10 @@ func SyncTreeBidirectionally(
return err
}
pendingQueries := make(chan []int32, 10000)
pendingQueries <- []int32{}
pendingQueries := make(chan []int32)
go func(path []int32) {
pendingQueries <- path
}([]int32{})
incoming := make(chan *protobufs.HypergraphComparison, 10000)
go func() {
@ -730,7 +736,9 @@ func SyncTreeBidirectionally(
append([]int32(nil), remoteInfo.Path...),
remoteChild.Index,
)
pendingQueries <- newPath
go func(path []int32) {
pendingQueries <- path
}(newPath)
}
}
}