11"""A module for Split.io Factories."""
22import logging
33import threading
4- import sys
54from collections import Counter
65
76from enum import Enum
@@ -419,9 +418,6 @@ def _build_in_memory_factory(api_key, cfg, sdk_url=None, events_url=None, # pyl
419418 )
420419
421420 telemetry_init_producer .record_config (cfg , extra_cfg )
422- if int (_get_uwsgi_worker_id ()) > - 1 :
423- telemetry_init_producer .add_config_tag ("initilization:uwsgi" )
424- telemetry_init_producer .add_config_tag ("uwsgi_worker:#" + _get_uwsgi_worker_id ())
425421
426422 if preforked_initialization :
427423 synchronizer .sync_all (max_retry_attempts = _MAX_RETRY_SYNC_ALL )
@@ -503,9 +499,6 @@ def _build_redis_factory(api_key, cfg):
503499 initialization_thread .start ()
504500
505501 telemetry_init_producer .record_config (cfg , {})
506- if int (_get_uwsgi_worker_id ()) > - 1 :
507- telemetry_init_producer .add_config_tag ("initilization:uwsgi" )
508- telemetry_init_producer .add_config_tag ("uwsgi_worker:#" + _get_uwsgi_worker_id ())
509502
510503 split_factory = SplitFactory (
511504 api_key ,
@@ -622,13 +615,4 @@ def _get_active_and_redundant_count():
622615 redundant_factory_count += _INSTANTIATED_FACTORIES [item ] - 1
623616 active_factory_count += _INSTANTIATED_FACTORIES [item ]
624617 _INSTANTIATED_FACTORIES_LOCK .release ()
625- return redundant_factory_count , active_factory_count
626-
627- def _get_uwsgi_worker_id ():
628- try :
629- import uwsgi
630- _LOGGER .debug ("uwsgi lib detected" )
631- return str (uwsgi .worker_id ())
632- except ModuleNotFoundError :
633- pass
634- return "-1"
618+ return redundant_factory_count , active_factory_count
0 commit comments