Skip to content

Commit b440e50

Browse files
committed
Derive Clone on Qdrant client
1 parent ab0677f commit b440e50

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/qdrant_client/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ mod snapshot;
1313
mod version_check;
1414

1515
use std::future::Future;
16+
use std::sync::Arc;
1617
use std::thread;
1718

1819
use tonic::codegen::InterceptedService;
@@ -82,12 +83,13 @@ pub type QdrantBuilder = QdrantConfig;
8283
/// - [`create_collection`](Self::create_collection) - create a new collection
8384
/// - [`upsert_points`](Self::upsert_points) - insert or update points
8485
/// - [`search_points`](Self::search_points) - search points with similarity search
86+
#[derive(Clone)]
8587
pub struct Qdrant {
8688
/// Client configuration
8789
pub config: QdrantConfig,
8890

8991
/// Internal connection pool
90-
channel: ChannelPool,
92+
channel: Arc<ChannelPool>,
9193
}
9294

9395
/// # Construct and connect
@@ -107,7 +109,7 @@ impl Qdrant {
107109
config.keep_alive_while_idle,
108110
);
109111
let client = Self {
110-
channel,
112+
channel: Arc::new(channel),
111113
config: config.clone(),
112114
};
113115

@@ -151,7 +153,7 @@ impl Qdrant {
151153
config.keep_alive_while_idle,
152154
);
153155

154-
let client = Self { channel, config };
156+
let client = Self { channel: Arc::new(channel), config };
155157

156158
Ok(client)
157159
}

0 commit comments

Comments
 (0)