Example #1
0
 def _fsync(self, f):
     if self.configuration.get("storage", "_filesystem_fsync"):
         try:
             pathutils.fsync(f.fileno())
         except OSError as e:
             raise RuntimeError("Fsync'ing file %r failed: %s" %
                                (f.name, e)) from e
Example #2
0
    def _sync_directory(self, path):
        """Sync directory to disk.

        This only works on POSIX and does nothing on other systems.

        """
        if not self.configuration.get("storage", "_filesystem_fsync"):
            return
        if os.name == "posix":
            try:
                fd = os.open(path, 0)
                try:
                    pathutils.fsync(fd)
                finally:
                    os.close(fd)
            except OSError as e:
                raise RuntimeError("Fsync'ing directory %r failed: %s" %
                                   (path, e)) from e
Example #3
0
 def _fsync(self, fd):
     if self.configuration.get("storage", "_filesystem_fsync"):
         pathutils.fsync(fd)
Example #4
0
 def _fsync(self, fd):
     if self.configuration.get("internal", "filesystem_fsync"):
         pathutils.fsync(fd)
Example #5
0
 def _fsync(cls, fd):
     if cls.configuration.getboolean("internal", "filesystem_fsync"):
         pathutils.fsync(fd)
Example #6
0
 def _fsync(cls, fd):
     if cls.configuration.getboolean("internal", "filesystem_fsync"):
         pathutils.fsync(fd)