File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
notebook/static/notebook/js Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2738,10 +2738,12 @@ define([
27382738 return this . contents . get ( this . notebook_path , { content : false } ) . then (
27392739 function ( data ) {
27402740 var last_modified = new Date ( data . last_modified ) ;
2741+ var last_modified_check_margin = ( that . config . data [ 'last_modified_check_margin' ] || 0.5 ) * 1000 ; // 500 ms
27412742 // We want to check last_modified (disk) > that.last_modified (our last save)
27422743 // In some cases the filesystem reports an inconsistent time,
27432744 // so we allow 0.5 seconds difference before complaining.
2744- if ( ( last_modified . getTime ( ) - that . last_modified . getTime ( ) ) > 500 ) { // 500 ms
2745+ // This is configurable in nbconfig/notebook.json as `last_modified_check_margin`.
2746+ if ( ( last_modified . getTime ( ) - that . last_modified . getTime ( ) ) > last_modified_check_margin ) {
27452747 console . warn ( "Last saving was done on `" + that . last_modified + "`(" + that . _last_modified + "), " +
27462748 "while the current file seem to have been saved on `" + data . last_modified + "`" ) ;
27472749 if ( that . _changed_on_disk_dialog !== null ) {
You can’t perform that action at this time.
0 commit comments