Skip to content

Commit ca63c06

Browse files
authored
update comment, keep configuration update behind conditional (microsoft#210103)
* only change backup frequency in experiment or remote * revert IW outputs
1 parent d748e6a commit ca63c06

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,18 @@ export class NotebookFileWorkingCopyModel extends Disposable implements IStoredF
218218
}
219219
}));
220220

221-
this.configuration = {
222-
// Intentionally pick a larger delay for triggering backups when
223-
// we are connected to a remote. This saves us repeated roundtrips
224-
// to the remote server when the content changes because the
225-
// remote hosts the extension of the notebook with the contents truth
226-
backupDelay: 10000
227-
};
221+
const saveWithReducedCommunication = this._configurationService.getValue(NotebookSetting.remoteSaving);
222+
223+
if (saveWithReducedCommunication || _notebookModel.uri.scheme === Schemas.vscodeRemote) {
224+
this.configuration = {
225+
// Intentionally pick a larger delay for triggering backups to allow auto-save
226+
// to complete first on the optimized save path
227+
backupDelay: 10000
228+
};
229+
}
228230

229231
// Override save behavior to avoid transferring the buffer across the wire 3 times
230-
if (this._configurationService.getValue(NotebookSetting.remoteSaving)) {
232+
if (saveWithReducedCommunication) {
231233
this.save = async (options: IWriteFileOptions, token: CancellationToken) => {
232234
const serializer = await this.getNotebookSerializer();
233235

0 commit comments

Comments
 (0)