private void ExecuteFileOrNetworkRequest() { try { using (BlobSizes.BlobSizesConnection blobSizesConnection = this.FileSystemCallbacks.BlobSizes.CreateConnection()) { FileOrNetworkRequest request; while (this.fileAndNetworkRequests.TryTake(out request, Timeout.Infinite)) { try { request.Work(blobSizesConnection); } catch (Exception e) { EventMetadata metadata = this.CreateEventMetadata(relativePath: null, exception: e); this.LogUnhandledExceptionAndExit($"{nameof(this.ExecuteFileOrNetworkRequest)}_Work", metadata); } try { request.Cleanup(); } catch (Exception e) { EventMetadata metadata = this.CreateEventMetadata(relativePath: null, exception: e); this.LogUnhandledExceptionAndExit($"{nameof(this.ExecuteFileOrNetworkRequest)}_Cleanup", metadata); } } } } catch (Exception e) { EventMetadata metadata = this.CreateEventMetadata(relativePath: null, exception: e); this.LogUnhandledExceptionAndExit($"{nameof(this.ExecuteFileOrNetworkRequest)}", metadata); } }
/// <summary> /// Populates the sizes of child entries in the folder using locally available data /// </summary> private void PopulateSizesLocally( ITracer tracer, GVFSGitObjects gitObjects, BlobSizes.BlobSizesConnection blobSizesConnection, Dictionary <string, long> availableSizes, out HashSet <string> missingShas, out List <FileMissingSize> childrenMissingSizes) { if (this.ChildrenHaveSizes) { missingShas = null; childrenMissingSizes = null; return; } missingShas = new HashSet <string>(); childrenMissingSizes = new List <FileMissingSize>(); for (int i = 0; i < this.ChildEntries.Count; i++) { FileData childEntry = this.ChildEntries[i] as FileData; if (childEntry != null) { string sha; if (!childEntry.TryPopulateSizeLocally(tracer, gitObjects, blobSizesConnection, availableSizes, out sha)) { childrenMissingSizes.Add(new FileMissingSize(childEntry, sha)); missingShas.Add(sha); } } } if (childrenMissingSizes.Count == 0) { this.ChildrenHaveSizes = true; } }