@@ -80,7 +80,7 @@ def __init__(
8080 ):
8181 self .sdk_key = sdk_key
8282 self .error_boundary = error_boundary
83- self .statsig_options = options
83+ self .options = options
8484 self .diagnostics = diagnostics
8585 self .shutdown_event = shutdown_event
8686 self .statsig_metadata = statsig_metadata
@@ -91,7 +91,7 @@ def __init__(
9191 self .id_list_worker : IStatsigNetworkWorker = defaultHttpWorker
9292 self .log_event_worker : IStatsigNetworkWorker = defaultHttpWorker
9393 self .http_worker : IStatsigNetworkWorker = defaultHttpWorker
94- for endpoint , config in options .proxy_configs .items ():
94+ for endpoint , config in self . options .proxy_configs .items ():
9595 protocol = config .protocol
9696 if protocol == NetworkProtocol .GRPC :
9797 self .load_grpc_worker (endpoint , config )
@@ -107,7 +107,7 @@ def load_grpc_websocket_worker(self, endpoint: NetworkEndpoint, config: ProxyCon
107107 grpc_webhook_worker = grpc_webhook_worker_class (
108108 self .sdk_key ,
109109 config ,
110- self .statsig_options ,
110+ self .options ,
111111 self .error_boundary ,
112112 self .diagnostics ,
113113 self .shutdown_event ,
@@ -156,7 +156,7 @@ def get_dcs(
156156 log_on_exception : Optional [bool ] = False ,
157157 init_timeout : Optional [int ] = None ,
158158 ):
159- if self .statsig_options .local_mode :
159+ if self .options .local_mode :
160160 globals .logger .warning ("Local mode is enabled. Not fetching DCS." )
161161 return
162162 self .dcs_worker .get_dcs (on_complete , since_time , log_on_exception , init_timeout )
@@ -168,14 +168,14 @@ def get_dcs_fallback(
168168 log_on_exception : Optional [bool ] = False ,
169169 init_timeout : Optional [int ] = None ,
170170 ):
171- if self .statsig_options .local_mode :
171+ if self .options .local_mode :
172172 globals .logger .warning ("Local mode is enabled. Not fetching DCS with fallback." )
173173 return
174- dcs_proxy = self .statsig_options .proxy_configs .get (NetworkEndpoint .DOWNLOAD_CONFIG_SPECS )
174+ dcs_proxy = self .options .proxy_configs .get (NetworkEndpoint .DOWNLOAD_CONFIG_SPECS )
175175 is_proxy_dcs = (
176176 dcs_proxy
177177 and dcs_proxy .proxy_address != STATSIG_CDN
178- or self .statsig_options .api_for_download_config_specs != STATSIG_CDN
178+ or self .options .api_for_download_config_specs != STATSIG_CDN
179179 )
180180 if is_proxy_dcs :
181181 self .http_worker .get_dcs_fallback (on_complete , since_time , log_on_exception , init_timeout )
@@ -186,7 +186,7 @@ def get_id_lists(
186186 log_on_exception : Optional [bool ] = False ,
187187 init_timeout : Optional [int ] = None ,
188188 ):
189- if self .statsig_options .local_mode :
189+ if self .options .local_mode :
190190 globals .logger .warning ("Local mode is enabled. Not fetching ID Lists." )
191191 return
192192 self .id_list_worker .get_id_lists (on_complete , log_on_exception , init_timeout )
@@ -197,42 +197,42 @@ def get_id_lists_fallback(
197197 log_on_exception : Optional [bool ] = False ,
198198 init_timeout : Optional [int ] = None ,
199199 ):
200- if self .statsig_options .local_mode :
200+ if self .options .local_mode :
201201 globals .logger .warning ("Local mode is enabled. Not fetching ID Lists with fallback." )
202202 return
203- if not self .statsig_options .fallback_to_statsig_api :
203+ if not self .options .fallback_to_statsig_api :
204204 return
205- id_list_proxy = self .statsig_options .proxy_configs .get (
205+ id_list_proxy = self .options .proxy_configs .get (
206206 NetworkEndpoint .GET_ID_LISTS
207207 )
208- id_list_api_override = self .statsig_options .api_for_get_id_lists
208+ id_list_api_override = self .options .api_for_get_id_lists
209209 is_id_lists_proxy = id_list_api_override != STATSIG_API or (
210210 id_list_proxy and id_list_proxy .proxy_address != STATSIG_API )
211211 if is_id_lists_proxy :
212212 self .http_worker .get_id_lists_fallback (on_complete , log_on_exception , init_timeout )
213213
214214 def get_id_list (self , on_complete : Any , url , headers , log_on_exception = False ):
215- if self .statsig_options .local_mode :
215+ if self .options .local_mode :
216216 globals .logger .warning ("Local mode is enabled. Not fetching ID List." )
217217 return
218218 self .http_worker .get_id_list (on_complete , url , headers , log_on_exception )
219219
220220 def log_events (self , payload , headers = None , log_on_exception = False , retry = 0 ):
221- if self .statsig_options .local_mode :
221+ if self .options .local_mode :
222222 globals .logger .warning ("Local mode is enabled. Not logging events." )
223223 return None
224224 return self .log_event_worker .log_events (
225225 payload , headers = headers , log_on_exception = log_on_exception , retry = retry
226226 )
227227
228228 def listen_for_dcs (self , listeners : IStreamingListeners , fallback : Callable ):
229- if self .statsig_options .local_mode :
229+ if self .options .local_mode :
230230 globals .logger .warning ("Local mode is enabled. Not listening for DCS." )
231231 return
232232 if isinstance (self .dcs_worker , IStatsigWebhookWorker ):
233233 self .dcs_worker .start_listen_for_config_spec (listeners )
234234 interval = (
235- self .statsig_options .rulesets_sync_interval
235+ self .options .rulesets_sync_interval
236236 or DEFAULT_RULESET_SYNC_INTERVAL
237237 )
238238 callbacks = StreamingFallback (
@@ -244,7 +244,7 @@ def listen_for_dcs(self, listeners: IStreamingListeners, fallback: Callable):
244244 self .dcs_worker .register_fallback_cb (callbacks )
245245
246246 def listen_for_id_lists (self , listeners : IStreamingListeners ):
247- if self .statsig_options .local_mode :
247+ if self .options .local_mode :
248248 globals .logger .warning ("Local mode is enabled. Not listening for ID Lists." )
249249 return
250250 if isinstance (self .id_list_worker , IStatsigWebhookWorker ):
0 commit comments