-
-
Notifications
You must be signed in to change notification settings - Fork 508
Fix Foundatio NRT nullable reference type errors #2202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ae3ddb2
2e7bea5
cdd0d33
fef37ed
7d95ef4
8806739
ba15079
6df2f37
b48a8eb
013a58e
9928234
2ba30f9
af2d3da
077e6a8
6a4a0bf
764a671
b21557d
f01c18d
0f1f604
6c65474
b1441b8
fac7831
20d209d
c8fc442
8516cbd
beb731f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,13 +5,13 @@ | |||||
| using Exceptionless.Core.Plugins.EventParser; | ||||||
| using Exceptionless.Core.Queues.Models; | ||||||
| using Exceptionless.Core.Repositories; | ||||||
| using Foundatio.Repositories.Exceptions; | ||||||
| using Exceptionless.Core.Services; | ||||||
| using Exceptionless.Core.Validation; | ||||||
| using FluentValidation; | ||||||
| using Foundatio.Jobs; | ||||||
| using Foundatio.Queues; | ||||||
| using Foundatio.Repositories; | ||||||
| using Foundatio.Repositories.Exceptions; | ||||||
| using Foundatio.Resilience; | ||||||
| using Microsoft.Extensions.Logging; | ||||||
| using Newtonsoft.Json; | ||||||
|
|
@@ -54,10 +54,11 @@ public EventPostsJob(IQueue<EventPost> queue, EventPostService eventPostService, | |||||
| protected override async Task<JobResult> ProcessQueueEntryAsync(QueueEntryContext<EventPost> context) | ||||||
| { | ||||||
| var entry = context.QueueEntry; | ||||||
| var ep = entry.Value; | ||||||
| var ep = entry.Value!; | ||||||
|
|
||||||
| using var _ = _logger.BeginScope(new ExceptionlessState().Organization(ep.OrganizationId).Project(ep.ProjectId)); | ||||||
|
|
||||||
| string payloadPath = Path.ChangeExtension(entry.Value.FilePath, ".payload"); | ||||||
| string payloadPath = Path.ChangeExtension(ep.FilePath, ".payload"); | ||||||
| var payloadTask = AppDiagnostics.PostsMarkFileActiveTime.TimeAsync(() => _eventPostService.GetEventPostPayloadAsync(payloadPath)); | ||||||
| var projectTask = _projectRepository.GetByIdAsync(ep.ProjectId, o => o.Cache()); | ||||||
| var organizationTask = _organizationRepository.GetByIdAsync(ep.OrganizationId, o => o.Cache()); | ||||||
|
|
@@ -124,7 +125,10 @@ protected override async Task<JobResult> ProcessQueueEntryAsync(QueueEntryContex | |||||
| if (uncompressedData.Length > maxEventPostSize) | ||||||
| { | ||||||
| var org = await organizationTask; | ||||||
| await _usageService.IncrementTooBigAsync(org.Id, project.Id); | ||||||
| if (org is not null) | ||||||
| await _usageService.IncrementTooBigAsync(org.Id, project.Id); | ||||||
| else | ||||||
| _logger.LogWarning("Organization {OrganizationId} not found, skipping too-big usage increment for event post {EventPostId}", ep.OrganizationId, entry.Id); | ||||||
| await CompleteEntryAsync(entry, ep, _timeProvider.GetUtcNow().UtcDateTime); | ||||||
| return JobResult.FailedWithMessage($"Unable to process decompressed EventPost data '{payloadPath}' ({payload.Length} bytes compressed, {uncompressedData.Length} bytes): Maximum uncompressed event post size limit ({maxEventPostSize} bytes) reached."); | ||||||
| } | ||||||
|
|
@@ -322,7 +326,7 @@ await _eventPostService.EnqueueAsync(new EventPost(false) | |||||
| if (!isInternalProject && _logger.IsEnabled(LogLevel.Critical)) | ||||||
| { | ||||||
| using (_logger.BeginScope(new ExceptionlessState().Property("Event", new { ev.Date, ev.StackId, ev.Type, ev.Source, ev.Message, ev.Value, ev.Geo, ev.ReferenceId, ev.Tags }))) | ||||||
| _logger.LogCritical(ex, "Error while requeuing event post {FilePath}: {Message}", queueEntry.Value.FilePath, ex.Message); | ||||||
| _logger.LogCritical(ex, "Error while requeuing event post {QueueEntryId} {FilePath}: {Message}", queueEntry.Id, queueEntry.Value!.FilePath, ex.Message); | ||||||
|
||||||
| _logger.LogCritical(ex, "Error while requeuing event post {QueueEntryId} {FilePath}: {Message}", queueEntry.Id, queueEntry.Value!.FilePath, ex.Message); | |
| _logger.LogCritical(ex, "Error while requeuing event post {QueueEntryId} {FilePath}: {Message}", queueEntry.Id, queueEntry.Value?.FilePath ?? ep.FilePath, ex.Message); |
Uh oh!
There was an error while loading. Please reload this page.