ha(H1): ниты повторного ревью — гарантия destroy при повторном close, rate-limit warn
- close() из другого потока после close из reader-колбэка теперь джойнит reader (гарантия, что destroy завершён к возврату); - предупреждения о переполнении очередей не чаще 1/30 с; - events_dropped сохраняет последнее значение после close; - find_library выбирает .so по версии (а не по длине имени).
This commit is contained in:
+7
-2
@@ -206,12 +206,17 @@ def find_library() -> str:
|
||||
return env
|
||||
pkg = Path(__file__).resolve().parent
|
||||
pattern = re.compile(r"^libfgl-aircon\.(so(\.[0-9.]+)?|dylib|\d+\.dylib)$")
|
||||
|
||||
def version_key(path: Path) -> tuple[int, ...]:
|
||||
match = re.search(r"\.so\.(\d+(?:\.\d+)*)$", path.name)
|
||||
return tuple(int(part) for part in match.group(1).split(".")) if match else ()
|
||||
|
||||
candidates = sorted(
|
||||
(p for p in pkg.iterdir() if p.is_file() and pattern.match(p.name)),
|
||||
key=lambda p: (p.name.count("."), len(p.name)),
|
||||
key=version_key,
|
||||
)
|
||||
if candidates:
|
||||
return str(candidates[0])
|
||||
return str(candidates[-1])
|
||||
system = ctypes.util.find_library("fgl-aircon")
|
||||
if system:
|
||||
return system
|
||||
|
||||
Reference in New Issue
Block a user