From ca565f2490556329069ebf25d344884cf16a2c37 Mon Sep 17 00:00:00 2001 From: Egor Komarov Date: Wed, 9 Oct 2024 14:20:25 +0200 Subject: [PATCH] feat(EWM-342): gql transport params --- .../transport_repository_abstract.dart | 3 +++ .../transport_repository_impl.dart | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/src/repositories/transport_repository/transport_repository_abstract.dart b/lib/src/repositories/transport_repository/transport_repository_abstract.dart index edb04ea..381ba3d 100644 --- a/lib/src/repositories/transport_repository/transport_repository_abstract.dart +++ b/lib/src/repositories/transport_repository/transport_repository_abstract.dart @@ -42,6 +42,9 @@ abstract class TransportRepository { required String group, required List endpoints, required bool local, + int? latencyDetectionInterval, + int? maxLatency, + int? endpointSelectionRetryCount, }); /// This allows create Protobuf based transport from application. diff --git a/lib/src/repositories/transport_repository/transport_repository_impl.dart b/lib/src/repositories/transport_repository/transport_repository_impl.dart index ff701ae..670c671 100644 --- a/lib/src/repositories/transport_repository/transport_repository_impl.dart +++ b/lib/src/repositories/transport_repository/transport_repository_impl.dart @@ -44,12 +44,17 @@ mixin TransportRepositoryImpl implements TransportRepository { required String group, required List endpoints, required bool local, + int? latencyDetectionInterval, + int? maxLatency, + int? endpointSelectionRetryCount, }) async { final settings = GqlNetworkSettings( endpoints: endpoints, - latencyDetectionInterval: defaultLatencyDetectionInterval, - maxLatency: defaultMaxLatency, - endpointSelectionRetryCount: defaultEndpointSelectionRetryCount, + latencyDetectionInterval: + latencyDetectionInterval ?? defaultLatencyDetectionInterval, + maxLatency: maxLatency ?? defaultMaxLatency, + endpointSelectionRetryCount: + endpointSelectionRetryCount ?? defaultEndpointSelectionRetryCount, local: local, );