Skip to content

Commit

Permalink
fix issue with returning a connection to the pool too early (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehooi authored Jul 17, 2024
1 parent b2426b9 commit 151ba0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions milvus/utils/Function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ export async function promisify(
if (err) {
// If there was an error, reject the Promise with the error
reject(err);
} else {
// Otherwise, resolve the Promise with the result
resolve(result);
}
if (client) {
pool.release(client);
}
// Otherwise, resolve the Promise with the result
resolve(result);
}
);
} catch (e: any) {
reject(e);
} finally {
if (client) {
pool.release(client);
}
Expand Down

0 comments on commit 151ba0d

Please sign in to comment.