Addressed Ruff checks for Unix socket startup path handling.
Audit / Dependencies (push) Successful in 6s
CD / Publish (push) Successful in 5s
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (push) Successful in 7s
CI / Type Checking (push) Successful in 10s
CI / Spelling (push) Successful in 5s

This commit is contained in:
2026-06-11 15:11:51 -04:00
parent 446c0cd9ca
commit 6d7f26f7be
+6 -2
View File
@@ -202,8 +202,12 @@ class MetricsServer:
)
else:
socket_path = Path(self._address.path)
# This runs once before binding the Unix site, so synchronous
# path checks are simpler than offloading startup setup.
try:
mode = socket_path.stat(follow_symlinks=False).st_mode
mode = socket_path.stat( # noqa: ASYNC240
follow_symlinks=False,
).st_mode
except FileNotFoundError:
pass
else:
@@ -229,7 +233,7 @@ class MetricsServer:
raise OSError(errno.EADDRINUSE, msg)
with contextlib.suppress(FileNotFoundError):
socket_path.unlink()
socket_path.unlink() # noqa: ASYNC240
site = web.UnixSite(self._runner, self._address.path)
await site.start()