@@ -177,17 +177,28 @@ def __init__(
177177
178178 self ._initialise_local_evaluation ()
179179
180- if enable_analytics :
181- self ._analytics_processor = AnalyticsProcessor (
182- environment_key , self .api_url , timeout = self .request_timeout_seconds
183- )
180+ self ._initialise_analytics (
181+ environment_key = environment_key ,
182+ enable_analytics = enable_analytics ,
183+ pipeline_analytics_config = pipeline_analytics_config ,
184+ )
184185
185- if pipeline_analytics_config :
186- self ._pipeline_analytics_processor = PipelineAnalyticsProcessor (
187- config = pipeline_analytics_config ,
188- environment_key = environment_key ,
189- )
190- self ._pipeline_analytics_processor .start ()
186+ def _initialise_analytics (
187+ self ,
188+ environment_key : str ,
189+ enable_analytics : bool ,
190+ pipeline_analytics_config : typing .Optional [PipelineAnalyticsConfig ],
191+ ) -> None :
192+ if enable_analytics :
193+ self ._analytics_processor = AnalyticsProcessor (
194+ environment_key , self .api_url , timeout = self .request_timeout_seconds
195+ )
196+ if pipeline_analytics_config :
197+ self ._pipeline_analytics_processor = PipelineAnalyticsProcessor (
198+ config = pipeline_analytics_config ,
199+ environment_key = environment_key ,
200+ )
201+ self ._pipeline_analytics_processor .start ()
191202
192203 def _initialise_local_evaluation (self ) -> None :
193204 # To ensure that the environment is set before allowing subsequent
0 commit comments