Files
kk8bit-KayTool/api
kk8bit e5770345a9 Stop the resource monitor dying when pynvml is absent
The guard around the pynvml import was written as

    except (ImportError, pynvml.NVMLError):

but when the import is what failed, the name pynvml is unbound, so
evaluating the except clause raises NameError — which that clause does not
catch. The handler blew up in precisely the situation it existed for:
Linux or Windows without pynvml installed.

It propagates out of the collector's constructor into monitor_loop, which
runs as a bare create_task, so nothing reports it beyond a "Task exception
was never retrieved" at GC time. The monitor just never produces data, and
running stays True, so a later start() takes the already-running branch.

Catch Exception instead, and wrap the loop so any failure is logged and
running is reset.
2026-09-20 21:56:44 +08:00
..
2025-04-26 19:08:55 +08:00