mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-06 17:38:35 +00:00
refactor(session): simplify directory fsync handling
This commit is contained in:
parent
4a79cbb6e7
commit
afc65c086e
@ -694,11 +694,10 @@ class SessionManager:
|
|||||||
with suppress(PermissionError):
|
with suppress(PermissionError):
|
||||||
fd = os.open(str(path.parent), os.O_RDONLY)
|
fd = os.open(str(path.parent), os.O_RDONLY)
|
||||||
try:
|
try:
|
||||||
try:
|
os.fsync(fd)
|
||||||
os.fsync(fd)
|
except OSError as exc:
|
||||||
except OSError as exc:
|
if exc.errno != errno.EINVAL:
|
||||||
if exc.errno != errno.EINVAL:
|
raise
|
||||||
raise
|
|
||||||
finally:
|
finally:
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user