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

Make buffer time between last modified on disk and last modified on last save configurable #3273

Merged
merged 3 commits into from Feb 5, 2018

Conversation

Projects
None yet
3 participants
@gnestor
Copy link
Contributor

gnestor commented Jan 28, 2018

Suggested by #484 (comment)

This will look in notebook.json in ~/.jupyter/nbconfig/notebook.json for a last_modified_buffer value. For example:

{
  "Notebook": {
    "Header": false,
    "Toolbar": true
  },
  "Cell": {
    "cm_config": {
      "lineNumbers": false
    }
  },
  "last_modified_buffer": 600
}

Can anyone think of better name than last_modified_buffer?

@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Jan 28, 2018

I'm trying to think of a better word than 'buffer', because that suggests a temporary storage area for data. Maybe last_modified_check_margin?

Also, I might make the config option in seconds rather than milliseconds; I think we generally try to keep intervals in seconds throughout our API for consistency (cc @minrk )

// We want to check last_modified (disk) > that.last_modified (our last save)
// In some cases the filesystem reports an inconsistent time,
// so we allow 0.5 seconds difference before complaining.
if ((last_modified.getTime() - that.last_modified.getTime()) > 500) { // 500 ms
// so we allow 0.5 seconds (configurable in nbconfig/notebook.json as `last_modified_buffer`) difference before complaining.

This comment has been minimized.

@takluyver

takluyver Feb 2, 2018

Member

Don't forget to update the name in the comment too.

@takluyver takluyver merged commit 364cd03 into jupyter:master Feb 5, 2018

4 checks passed

codecov/patch Coverage not affected when comparing b96d758...3fce87d
Details
codecov/project 78.76% remains the same compared to b96d758
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gnestor gnestor deleted the gnestor:issue-484 branch Feb 6, 2018

@brettbrocato

This comment has been minimized.

Copy link

brettbrocato commented Feb 12, 2019

I have tried "last_modified_buffer": 2 and "last_modified_check_margin": 3, assuming they're in seconds. They both cause all my notebooks to return a 500 error.

I've been trying to avoid the "overwrite?" dialog, which pops up as frequently as every 5 minutes. I'm on Win10 and notebook 5.7.0

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.