@@ -228,17 +228,23 @@ pub struct QdrantClient {
228228}
229229
230230impl QdrantClient {
231+ /// Wraps a channel with a token interceptor
232+ fn with_api_key ( & self , channel : Channel ) -> InterceptedService < Channel , TokenInterceptor > {
233+ let interceptor = TokenInterceptor :: new ( self . cfg . api_key . clone ( ) ) ;
234+ InterceptedService :: new ( channel, interceptor)
235+ }
236+
231237 pub async fn with_snapshot_client < T , O : Future < Output = Result < T , Status > > > (
232238 & self ,
233239 f : impl Fn ( SnapshotsClient < InterceptedService < Channel , TokenInterceptor > > ) -> O ,
234240 ) -> Result < T , Status > {
235241 self . channel
236242 . with_channel (
237243 |channel| {
238- f ( SnapshotsClient :: with_interceptor (
239- channel ,
240- TokenInterceptor :: new ( self . cfg . api_key . clone ( ) ) ,
241- ) )
244+ let service = self . with_api_key ( channel ) ;
245+ let client = SnapshotsClient :: new ( service ) ;
246+ let client = client . max_decoding_message_size ( usize :: MAX ) ;
247+ f ( client )
242248 } ,
243249 false ,
244250 )
@@ -253,10 +259,10 @@ impl QdrantClient {
253259 self . channel
254260 . with_channel (
255261 |channel| {
256- f ( CollectionsClient :: with_interceptor (
257- channel ,
258- TokenInterceptor :: new ( self . cfg . api_key . clone ( ) ) ,
259- ) )
262+ let service = self . with_api_key ( channel ) ;
263+ let client = CollectionsClient :: new ( service ) ;
264+ let client = client . max_decoding_message_size ( usize :: MAX ) ;
265+ f ( client )
260266 } ,
261267 false ,
262268 )
@@ -271,10 +277,10 @@ impl QdrantClient {
271277 self . channel
272278 . with_channel (
273279 |channel| {
274- f ( PointsClient :: with_interceptor (
275- channel ,
276- TokenInterceptor :: new ( self . cfg . api_key . clone ( ) ) ,
277- ) )
280+ let service = self . with_api_key ( channel ) ;
281+ let client = PointsClient :: new ( service ) ;
282+ let client = client . max_decoding_message_size ( usize :: MAX ) ;
283+ f ( client )
278284 } ,
279285 true ,
280286 )
@@ -289,10 +295,10 @@ impl QdrantClient {
289295 self . channel
290296 . with_channel (
291297 |channel| {
292- f ( qdrant_client :: QdrantClient :: with_interceptor (
293- channel ,
294- TokenInterceptor :: new ( self . cfg . api_key . clone ( ) ) ,
295- ) )
298+ let service = self . with_api_key ( channel ) ;
299+ let client = qdrant_client :: QdrantClient :: new ( service ) ;
300+ let client = client . max_decoding_message_size ( usize :: MAX ) ;
301+ f ( client )
296302 } ,
297303 true ,
298304 )
0 commit comments