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

@gnestor
Copy link
Contributor

@gnestor 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
Copy link
Member

@takluyver 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 )

Loading

// 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.
Copy link
Member

@takluyver takluyver Feb 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Loading

@takluyver takluyver merged commit 364cd03 into jupyter:master Feb 5, 2018
4 checks passed
Loading
@gnestor gnestor deleted the issue-484 branch Feb 6, 2018
@graphedge
Copy link

@graphedge graphedge 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

Loading

@philastrophist
Copy link

@philastrophist philastrophist commented Nov 25, 2019

Adding the line "last_modified_check_margin": 0.5 does nothing for me. This issue is not closed

Loading

@ckbhatt
Copy link

@ckbhatt ckbhatt commented Jan 29, 2020

Is there any plan to have this property configurable in Jupyter lab as well?

Loading

@blink1073
Copy link
Member

@blink1073 blink1073 commented Jun 12, 2020

@ckbhatt I opened jupyterlab/jupyterlab#8556 to track the feature in JupyterLab.

Loading

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants