Change config value name and use seconds vs. milliseconds

This commit is contained in:
Grant Nestor 2018-01-29 08:37:34 -08:00
parent c2701a8fb0
commit 798d29bda8

View File

@ -2738,11 +2738,11 @@ define([
return this.contents.get(this.notebook_path, {content: false}).then(
function (data) {
var last_modified = new Date(data.last_modified);
var difference_buffer = that.config.data['last_modified_buffer'] || 500; // 500 ms
var last_modified_check_margin = (that.config.data['last_modified_check_margin'] || 0.5) * 1000; // 500 ms
// 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 (configurable in nbconfig/notebook.json as `last_modified_buffer`) difference before complaining.
if ((last_modified.getTime() - that.last_modified.getTime()) > difference_buffer) {
if ((last_modified.getTime() - that.last_modified.getTime()) > last_modified_check_margin) {
console.warn("Last saving was done on `"+that.last_modified+"`("+that._last_modified+"), "+
"while the current file seem to have been saved on `"+data.last_modified+"`");
if (that._changed_on_disk_dialog !== null) {