qdrant-js icon indicating copy to clipboard operation
qdrant-js copied to clipboard

gRPC connection hangs forever

Open paciops opened this issue 7 months ago • 2 comments

I was using QdrantClient with gRPC, at the end of my script the node.js process hangs forever. Here there is small script to reproduce it (also as a gist).

const { QdrantClient, Distance } = require("@qdrant/js-client-grpc");

async function main(url, size, collectionName) {
  const client = new QdrantClient({ url });
  const createResponse = await client.api("collections").create({
    collectionName,
    vectorsConfig: {
      config: {
        case: "params",
        value: { size: BigInt(size), distance: Distance.Cosine },
      },
    },
  });
  console.log("collection creation response = ", createResponse.result);

  const deleteResponse = await client.api("collections").delete({
    collectionName,
  });
  console.log("collection deletion response = ", deleteResponse.result);

  return "done";
}

main("http://127.0.0.1:6334", 10, "sentences")
  .then((value) => console.log(value))
  .catch((error) => console.error(error));

paciops avatar Nov 06 '23 15:11 paciops