enhance: Use dynamic pool for NewLoadIndexInfo (#30489)

See also #30445

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2024-02-04 14:19:05 +08:00 committed by GitHub
parent e6eb6f2c78
commit 5143b8c793
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,11 @@ type LoadIndexInfo struct {
func newLoadIndexInfo(ctx context.Context) (*LoadIndexInfo, error) {
var cLoadIndexInfo C.CLoadIndexInfo
status := C.NewLoadIndexInfo(&cLoadIndexInfo)
var status C.CStatus
GetDynamicPool().Submit(func() (any, error) {
status = C.NewLoadIndexInfo(&cLoadIndexInfo)
return nil, nil
}).Await()
if err := HandleCStatus(ctx, &status, "NewLoadIndexInfo failed"); err != nil {
return nil, err
}