fix: Improve TracingService initialization logic around deactivated (#5847)
* fix: improve TracingService initialization logic - Updated the `start` method to remove the check for `self.deactivated`, allowing the service to start even if deactivated. - Added a check in `initialize_tracers` to return early if the service is deactivated, preventing unnecessary initialization calls. These changes streamline the service's startup process and ensure that tracer initialization respects the deactivated state. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
25bf7f9010
commit
c29e6ad3d5
1 changed files with 4 additions and 1 deletions
|
|
@ -77,7 +77,7 @@ class TracingService(Service):
|
|||
self.logs_queue.task_done()
|
||||
|
||||
async def start(self) -> None:
|
||||
if self.running or self.deactivated:
|
||||
if self.running:
|
||||
return
|
||||
try:
|
||||
self.running = True
|
||||
|
|
@ -112,8 +112,11 @@ class TracingService(Service):
|
|||
self.outputs_metadata = defaultdict(dict)
|
||||
|
||||
async def initialize_tracers(self) -> None:
|
||||
if self.deactivated:
|
||||
return
|
||||
try:
|
||||
await self.start()
|
||||
|
||||
self._initialize_langsmith_tracer()
|
||||
self._initialize_langwatch_tracer()
|
||||
self._initialize_langfuse_tracer()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue