Skip to content

Commit 87d00a6

Browse files
authored
Fix copy-paste errors in using uploader code in task (#165)
Fix copy-paste errors between uploader & download task
1 parent a9937d1 commit 87d00a6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/Microsoft.SourceIndexer.Tasks/DownloadStage1Index.cs

+10-7
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void ExecuteCore()
8686
LoggedQueryParameters = { "api-version" },
8787
IsAccountIdentifierLoggingEnabled = true
8888
},
89-
ManagedIdentityClientId = clientId };
89+
ManagedIdentityClientId = ClientId };
9090
Log.LogMessage($"Trying to use managed identity with client id: {ClientId}");
9191
}
9292

@@ -97,13 +97,15 @@ private void ExecuteCore()
9797
credential);
9898

9999
var containerClient = blobServiceClient.GetBlobContainerClient(BlobContainer);
100+
Pageable<BlobItem> blobs;
100101
try
101102
{
102-
Pageable<BlobItem> blobs = containerClient.GetBlobs(prefix: RepoName + "/");
103+
blobs = containerClient.GetBlobs(prefix: RepoName + "/");
103104
}
104105
catch (AuthenticationFailedException e)
105106
{
106-
Fatal($"*** BLOB ENUMERATION FAILED: {e.Message}");
107+
Log.LogError($"*** BLOB ENUMERATION FAILED: {e.Message}");
108+
return;
107109
}
108110
BlobItem newest = blobs.OrderByDescending(b => b.Name).FirstOrDefault();
109111
if (newest == null)
@@ -118,14 +120,15 @@ private void ExecuteCore()
118120
try
119121
{
120122
using Stream fileStream = blobClient.OpenRead();
123+
using var input = new GZipInputStream(fileStream);
124+
using var archive = TarArchive.CreateInputTarArchive(input, Encoding.UTF8);
125+
archive.ExtractContents(OutputDirectory, true); // would like this to be false, but SharpZipLib has a bug in 1.3.3
121126
}
122127
catch (AuthenticationFailedException e)
123128
{
124-
Fatal($"*** STREAM READ FAILED: {e.Message}");
129+
Log.LogError($"*** STREAM READ FAILED: {e.Message}");
130+
return;
125131
}
126-
using var input = new GZipInputStream(fileStream);
127-
using var archive = TarArchive.CreateInputTarArchive(input, Encoding.UTF8);
128-
archive.ExtractContents(OutputDirectory, true); // would like this to be false, but SharpZipLib has a bug in 1.3.3
129132
}
130133
}
131134
}

0 commit comments

Comments
 (0)