Set telemetry flag as a top level attribute (#462)
This commit is contained in:
@@ -98,6 +98,16 @@ class EmbedChain(JSONSerializable):
|
|||||||
thread_telemetry = threading.Thread(target=self._send_telemetry_event, args=("init",))
|
thread_telemetry = threading.Thread(target=self._send_telemetry_event, args=("init",))
|
||||||
thread_telemetry.start()
|
thread_telemetry.start()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def collect_metrics(self):
|
||||||
|
return self.config.collect_metrics
|
||||||
|
|
||||||
|
@collect_metrics.setter
|
||||||
|
def collect_metrics(self, value):
|
||||||
|
if not isinstance(value, bool):
|
||||||
|
raise ValueError(f"Boolean value expected but got {type(value)}.")
|
||||||
|
self.config.collect_metrics = value
|
||||||
|
|
||||||
def _load_or_generate_user_id(self) -> str:
|
def _load_or_generate_user_id(self) -> str:
|
||||||
"""
|
"""
|
||||||
Loads the user id from the config file if it exists, otherwise generates a new
|
Loads the user id from the config file if it exists, otherwise generates a new
|
||||||
|
|||||||
Reference in New Issue
Block a user