Ejemplo n.º 1
0
 def __init__(
     self,
     key: tuple[str, str],
     config: dict[str, Any],
     blueprint_inputs: dict[str, Any],
     context: Context,
 ):
     """Container for script trace."""
     self._trace: dict[str, deque[TraceElement]] | None = None
     self._config: dict[str, Any] = config
     self._blueprint_inputs: dict[str, Any] = blueprint_inputs
     self.context: Context = context
     self._error: Exception | None = None
     self._state: str = "running"
     self._script_execution: str | None = None
     self.run_id: str = str(next(self._run_ids))
     self._timestamp_finish: dt.datetime | None = None
     self._timestamp_start: dt.datetime = dt_util.utcnow()
     self.key: tuple[str, str] = key
     if trace_id_get():
         trace_set_child_id(self.key, self.run_id)
     trace_id_set((key, self.run_id))
Ejemplo n.º 2
0
 def __init__(
     self,
     item_id: str,
     config: dict[str, Any],
     blueprint_inputs: dict[str, Any],
     context: Context,
 ) -> None:
     """Container for script trace."""
     self._trace: dict[str, deque[TraceElement]] | None = None
     self._config: dict[str, Any] = config
     self._blueprint_inputs: dict[str, Any] = blueprint_inputs
     self.context: Context = context
     self._error: Exception | None = None
     self._state: str = "running"
     self._script_execution: str | None = None
     self.run_id: str = uuid_util.random_uuid_hex()
     self._timestamp_finish: dt.datetime | None = None
     self._timestamp_start: dt.datetime = dt_util.utcnow()
     self.key = f"{self._domain}.{item_id}"
     self._dict: dict[str, Any] | None = None
     self._short_dict: dict[str, Any] | None = None
     if trace_id_get():
         trace_set_child_id(self.key, self.run_id)
     trace_id_set((self.key, self.run_id))