Skip to content

Commit

Permalink
feat:import pkg
Browse files Browse the repository at this point in the history
Signed-off-by: FanOne <[email protected]>
  • Loading branch information
CocaineCong committed Jul 12, 2024
1 parent 1101219 commit fe9877f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 0 additions & 2 deletions pkg/util/distance/calc_distance.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
"sync"

"github.com/cockroachdb/errors"

"github.com/milvus-io/milvus/pkg/util/conc"
)

/**
Expand Down
18 changes: 12 additions & 6 deletions pkg/util/distance/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@

package distance

import (
"sync"

"github.com/milvus-io/milvus/pkg/util/conc"
)

var (
calcPool *conc.Pool[any]
calcPoolInitOnce = new(sync.Once)
calcPool *conc.Pool[any]
calcPoolInitOnce = new(sync.Once)
)

func initCalcPool() {
calcPool = conc.NewDefaultPool[any]()
calcPool = conc.NewDefaultPool[any]()
}

func GetCalcPool() *conc.Pool[any] {
calcPoolInitOnce.Do(initCalcPool)
return calcPool
}
calcPoolInitOnce.Do(initCalcPool)
return calcPool
}

0 comments on commit fe9877f

Please sign in to comment.