Skip to content

Commit c240df0

Browse files
committed
remote - use etag-check to prevent repeated loading
1 parent 7945915 commit c240df0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/vs/workbench/services/files/electron-browser/fileService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class FileService implements IFileService {
3535
private static readonly NET_VERSION_ERROR = 'System.MissingMethodException';
3636
private static readonly NET_VERSION_ERROR_IGNORE_KEY = 'ignoreNetVersionError';
3737

38-
private raw: IFileService;
38+
private raw: NodeFileService;
3939

4040
private toUnbind: IDisposable[];
4141

src/vs/workbench/services/files/electron-browser/remoteFileService.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,15 @@ export class RemoteFileService extends FileService {
233233
return this._withProvider(resource).then(provider => {
234234

235235
return this.resolveFile(resource).then(fileStat => {
236+
237+
if (options.etag === fileStat.etag) {
238+
throw new FileOperationError(
239+
localize('fileNotModifiedError', "File not modified since"),
240+
FileOperationResult.FILE_NOT_MODIFIED_SINCE,
241+
options
242+
);
243+
}
244+
236245
const guessEncoding = options.autoGuessEncoding;
237246
const count = maxBufferLen(options);
238247
const chunks: Buffer[] = [];

0 commit comments

Comments
 (0)