Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Remove file logging from RegistrationComparer now that AI logging is …
Browse files Browse the repository at this point in the history
…up (#733)

Make the comparison container (just a cursor) public for easy monitoring
Related to NuGet/NuGetGallery#7741
  • Loading branch information
joelverhagen committed Jan 24, 2020
1 parent 92ffe4a commit 87a20a0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/NuGet.Jobs.RegistrationComparer/HiveComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ await ParallelAsync.Repeat(
}
catch (InvalidOperationException ex)
{
ResultWriter.WriteWarning(ex.Message);
_logger.LogWarning(ex, "A comparison warning was found.");
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\AssemblyInfo.*.cs" />
<Compile Include="ResultWriter.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public async Task OnProcessBatchAsync(IEnumerable<CatalogCommitItem> items)
catch (Exception ex)
{
Interlocked.Increment(ref failures);
ResultWriter.WriteError(ex.Message.ToString());
_logger.LogError(ex, "The comparison failed.");
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using NuGet.Services.Metadata.Catalog;
using NuGet.Services.Metadata.Catalog.Persistence;
using NuGet.Services.V3;
Expand Down Expand Up @@ -48,10 +49,11 @@ public async Task ExecuteAsync(CancellationToken token)
_logger.LogInformation("Using cursor: {CursurUrl}", frontCursorPair.Key);
var frontCursor = frontCursorPair.Value;

await _storageAccount
var container = _storageAccount
.CreateCloudBlobClient()
.GetContainerReference(_options.Value.StorageContainer)
.CreateIfNotExistsAsync();
.GetContainerReference(_options.Value.StorageContainer);
await container.CreateIfNotExistsAsync();
await container.SetPermissionsAsync(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });

await frontCursor.LoadAsync(token);
await backCursor.LoadAsync(token);
Expand Down
30 changes: 0 additions & 30 deletions src/NuGet.Jobs.RegistrationComparer/ResultWriter.cs

This file was deleted.

0 comments on commit 87a20a0

Please sign in to comment.