We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In tinydb/storages.py, line 112, a call to self._handle.flush() is made, in the write() method inside the class JSONStorage:
self._handle.flush()
write()
JSONStorage
def write(self, data): self._handle.seek(0) serialized = json.dumps(data, **self.kwargs) self._handle.write(serialized) self._handle.flush() self._handle.truncate()
Is the goal of this call to flush to ensure all internal buffers associated with self._handle are written to disk?
flush
self._handle
If so, it may be a good idea to make a call to os.fsync() to ensure this behavior. ref: Python Docs
os.fsync()
I have already implemented this change in my fork. If this is the case, I will create a PR.
The text was updated successfully, but these errors were encountered:
Yes, as far as I can remember, that's the intent. I'm always glad to accept PRs 🙂
Sorry, something went wrong.
Cool. Will create one now.
Closed in #212, which also is released now 🙃
No branches or pull requests
In tinydb/storages.py, line 112, a call to
self._handle.flush()
is made, in thewrite()
method inside the classJSONStorage
:Is the goal of this call to
flush
to ensure all internal buffers associated withself._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.
The text was updated successfully, but these errors were encountered: