mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Fix crash
This commit is contained in:
parent
65e8b32ce9
commit
1cedf057e6
@ -89,8 +89,10 @@ def get_processing_stats(config: FrigateConfig, stats: dict[str, str]) -> None:
|
||||
|
||||
async def run_tasks() -> None:
|
||||
await asyncio.wait(
|
||||
[
|
||||
asyncio.create_task(set_gpu_stats(config, stats)),
|
||||
asyncio.create_task(set_cpu_stats(stats)),
|
||||
]
|
||||
)
|
||||
|
||||
loop = asyncio.new_event_loop()
|
||||
@ -99,7 +101,7 @@ def get_processing_stats(config: FrigateConfig, stats: dict[str, str]) -> None:
|
||||
loop.close()
|
||||
|
||||
|
||||
def set_cpu_stats(all_stats: dict[str, str]) -> None:
|
||||
async def set_cpu_stats(all_stats: dict[str, str]) -> None:
|
||||
"""Set cpu usage from top."""
|
||||
cpu_stats = get_cpu_stats()
|
||||
|
||||
@ -107,7 +109,7 @@ def set_cpu_stats(all_stats: dict[str, str]) -> None:
|
||||
all_stats["cpu_usages"] = cpu_stats
|
||||
|
||||
|
||||
def set_gpu_stats(config: FrigateConfig, all_stats: dict[str, str]) -> None:
|
||||
async def set_gpu_stats(config: FrigateConfig, all_stats: dict[str, str]) -> None:
|
||||
"""Parse GPUs from hwaccel args and use for stats."""
|
||||
hwaccel_args = []
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user