Apply linting fixes for better code formatting
- Added trailing commas for multi-line function calls - Improved line breaks for better readability
This commit is contained in:
parent
f6d61c06cb
commit
43d83a08d3
@ -510,8 +510,8 @@ class ThreadingService:
|
|||||||
finally:
|
finally:
|
||||||
duration = time.time() - start_time
|
duration = time.time() - start_time
|
||||||
logfire_logger.debug(
|
logfire_logger.debug(
|
||||||
"Rate limited operation completed",
|
"Rate limited operation completed",
|
||||||
extra={"duration": duration, "tokens": estimated_tokens}
|
extra={"duration": duration, "tokens": estimated_tokens},
|
||||||
)
|
)
|
||||||
|
|
||||||
async def run_cpu_intensive(self, func: Callable, *args, **kwargs) -> Any:
|
async def run_cpu_intensive(self, func: Callable, *args, **kwargs) -> Any:
|
||||||
@ -580,7 +580,9 @@ class ThreadingService:
|
|||||||
gc.collect()
|
gc.collect()
|
||||||
|
|
||||||
if metrics.cpu_percent > 95:
|
if metrics.cpu_percent > 95:
|
||||||
logfire_logger.warning("Critical CPU usage", extra={"cpu_percent": metrics.cpu_percent})
|
logfire_logger.warning(
|
||||||
|
"Critical CPU usage", extra={"cpu_percent": metrics.cpu_percent}
|
||||||
|
)
|
||||||
|
|
||||||
# Check for memory leaks (too many threads)
|
# Check for memory leaks (too many threads)
|
||||||
if metrics.active_threads > self.config.max_workers * 3:
|
if metrics.active_threads > self.config.max_workers * 3:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user