Skip to content
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

PR: Wait a bit repeatedly after save before reading notebook #348

Merged
merged 4 commits into from
Jan 4, 2021

Conversation

jitseniesen
Copy link
Member

When saving a newly created notebook in a temporary directory, we read it back to check whether it is empty; if not, we offer to save it in a more permanent location. Before, we waited one second between initiating the save and reading it back. Now, we wait 0.25 second, but keep trying if the file does not yet exist. This means the function runs faster if the save is expedient and it waits longer if the save runs slowly.

The first commit in the PR is the one providing the functionality, the other commits are refactoring and adding tests.

Fixes #339.

When saving a newly created notebook in a temporary directory, we read it
back to check whether it is empty; if not, we offer to save it in a more
permanent location. Before, we waited one second between initiating the
save and reading it back. Now, we wait 0.25 second, but keep trying if
the file does not yet exist. This means the function runs faster if the
save is expedient and it waits longer if the save runs slowly.
@jitseniesen jitseniesen added this to the v0.3.2 milestone Jan 3, 2021
@codecov-io
Copy link

Codecov Report

Merging #348 (9897430) into master (6e11df6) will increase coverage by 1.01%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
spyder_notebook/widgets/notebooktabwidget.py 91.66% <100.00%> (+4.48%) ⬆️

@jitseniesen jitseniesen merged commit c6c0127 into spyder-ide:master Jan 4, 2021
@jitseniesen jitseniesen deleted the save-wait branch January 4, 2021 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closing notebook freezes
2 participants