New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call os.fsync() following flush() #208

parkerduckworth opened this Issue Apr 9, 2018 · 3 comments


2 participants

parkerduckworth commented Apr 9, 2018

In tinydb/, line 112, a call to self._handle.flush() is made, in the write() method inside the class JSONStorage:

    def write(self, data):
        serialized = json.dumps(data, **self.kwargs)

Is the goal of this call to flush to ensure all internal buffers associated with self._handle are written to disk?

If so, it may be a good idea to make a call to os.fsync() to ensure this behavior.
ref: Python Docs

I have already implemented this change in my fork. If this is the case, I will create a PR.


This comment has been minimized.


msiemens commented Apr 17, 2018

Yes, as far as I can remember, that's the intent. I'm always glad to accept PRs 🙂


This comment has been minimized.


parkerduckworth commented Apr 23, 2018

Cool. Will create one now.


This comment has been minimized.


msiemens commented Apr 24, 2018

Closed in #212, which also is released now 🙃

@msiemens msiemens closed this Apr 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment