Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrakhman committed Dec 4, 2023
1 parent a218667 commit be4ee9b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion commonspace/requestmanager/requestmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (r *requestManager) QueueRequest(peerId string, req *spacesyncproto.ObjectS
defer r.Unlock()
pl, exists := r.pools[peerId]
if !exists {
pl = тewRequestPool(r.workers, r.queueSize)
pl = newRequestPool(r.workers, r.queueSize)
r.pools[peerId] = pl
pl.Run()
}
Expand Down
4 changes: 2 additions & 2 deletions commonspace/requestmanager/requestpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"go.uber.org/zap"
)

// тewRequestPool creates new requestPool
// newRequestPool creates new requestPool
// workers - how many processes will execute tasks
// maxSize - limit for queue size
func тewRequestPool(workers, maxSize int) *requestPool {
func newRequestPool(workers, maxSize int) *requestPool {
ctx, cancel := context.WithCancel(context.Background())
ss := &requestPool{
ctx: ctx,
Expand Down
4 changes: 2 additions & 2 deletions commonspace/requestmanager/requestpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestRequestPool_Add(t *testing.T) {
setBlock := func() {
<-ch
}
rp := тewRequestPool(2, 2)
rp := newRequestPool(2, 2)
err := rp.TryAdd("1", setBlock)
require.NoError(t, err)
err = rp.TryAdd("2", setBlock)
Expand Down Expand Up @@ -46,7 +46,7 @@ func TestRequestPool_Add(t *testing.T) {
firstVal := atomic.Int32{}
secondVal := atomic.Int32{}
thirdVal := atomic.Int32{}
rp := тewRequestPool(2, 2)
rp := newRequestPool(2, 2)
err := rp.TryAdd("1", func() {
firstVal.Store(1)
})
Expand Down

0 comments on commit be4ee9b

Please sign in to comment.