mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Improve log message when fsync'ing directory fails (fixes 656)
This commit is contained in:
parent
56c88b4c54
commit
d3a90d16c3
1 changed files with 8 additions and 4 deletions
|
@ -688,11 +688,15 @@ class Collection(BaseCollection):
|
||||||
if not cls.configuration.getboolean("storage", "filesystem_fsync"):
|
if not cls.configuration.getboolean("storage", "filesystem_fsync"):
|
||||||
return
|
return
|
||||||
if os.name == "posix":
|
if os.name == "posix":
|
||||||
fd = os.open(path, 0)
|
|
||||||
try:
|
try:
|
||||||
cls._fsync(fd)
|
fd = os.open(path, 0)
|
||||||
finally:
|
try:
|
||||||
os.close(fd)
|
cls._fsync(fd)
|
||||||
|
finally:
|
||||||
|
os.close(fd)
|
||||||
|
except OSError as e:
|
||||||
|
raise RuntimeError("Fsync'ing directory %r failed: %s" %
|
||||||
|
(path, e)) from e
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _makedirs_synced(cls, filesystem_path):
|
def _makedirs_synced(cls, filesystem_path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue