Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ae3ddb2
Update dependencies
niemyjski Apr 13, 2026
2e7bea5
Fix Foundatio NRT errors in Configuration, Job, and WorkItemHandler f…
niemyjski Apr 13, 2026
cdd0d33
Fix Foundatio NRT errors in Core domain layer (batch 2/3)
niemyjski Apr 13, 2026
fef37ed
Fix pre-canceled CancellationToken in lock acquisition
niemyjski Apr 13, 2026
7d95ef4
Fix Foundatio NRT errors in Insulation, Web, and test projects
niemyjski Apr 13, 2026
8806739
Fix Foundatio upgrade test failures
niemyjski Apr 14, 2026
ba15079
Address Copilot review: fix remaining pre-canceled CancellationTokens
niemyjski Apr 14, 2026
6df2f37
Use stack entity dates as fallback instead of DateTime.MinValue
niemyjski Apr 14, 2026
b48a8eb
Fix NRT correctness: restore non-blocking locks, remove hacks
niemyjski Apr 15, 2026
013a58e
chore: upgrade Foundatio to beta6 and fix NRT annotations
niemyjski Apr 15, 2026
9928234
Fix null parse result handling: treat as failure, not valid
niemyjski Apr 15, 2026
2ba30f9
pr feedback
niemyjski Apr 15, 2026
af2d3da
Merge remote-tracking branch 'origin/main' into feature/foundatio-nrt
niemyjski Apr 15, 2026
077e6a8
pr feedback
niemyjski Apr 15, 2026
6a4a0bf
Merge remote-tracking branch 'origin/main' into feature/foundatio-nrt
niemyjski Apr 15, 2026
764a671
PR Feedback
niemyjski Apr 16, 2026
b21557d
pr feedback
niemyjski Apr 16, 2026
f01c18d
pr feedback
niemyjski Apr 16, 2026
0f1f604
pr feedback
niemyjski Apr 16, 2026
6c65474
fixed build
niemyjski Apr 16, 2026
b1441b8
pr feedback
niemyjski Apr 16, 2026
fac7831
pr feedback
niemyjski Apr 16, 2026
20d209d
updated deps
niemyjski Apr 16, 2026
c8fc442
Fixed build
niemyjski Apr 16, 2026
8516cbd
The updated Foundatio now validates that FieldEquals (term query) ca…
niemyjski Apr 16, 2026
beb731f
Refactor filter query handling and update soft delete tests
niemyjski Apr 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.201" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.202" PrivateAssets="All"/>
<PackageReference Include="AsyncFixer" Version="2.1.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="7.0.0" PrivateAssets="All" />
</ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions src/Exceptionless.Core/Billing/StripeEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ private async Task InvoicePaymentSucceededAsync(Invoice invoice)
return;
}

if (String.IsNullOrEmpty(org.BillingChangedByUserId))
{
_logger.LogError("No billing user set for organization: {OrganizationId}", org.Id);
return;
}

var user = await _userRepository.GetByIdAsync(org.BillingChangedByUserId);
if (user is null)
{
Expand All @@ -172,6 +178,12 @@ private async Task InvoicePaymentFailedAsync(Invoice invoice)
return;
}

if (String.IsNullOrEmpty(org.BillingChangedByUserId))
{
_logger.LogError("No billing user set for organization: {OrganizationId}", org.Id);
return;
}

var user = await _userRepository.GetByIdAsync(org.BillingChangedByUserId);
if (user is null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Configuration/CacheOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CacheOptions
{
public string? ConnectionString { get; internal set; }
public string? Provider { get; internal set; }
public Dictionary<string, string> Data { get; internal set; } = null!;
public Dictionary<string, string?> Data { get; internal set; } = null!;

public string Scope { get; internal set; } = null!;
public string ScopePrefix { get; internal set; } = null!;
Expand All @@ -26,7 +26,7 @@ public static CacheOptions ReadFromConfiguration(IConfiguration config, AppOptio
string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null;

var providerOptions = providerConnectionString.ParseConnectionString(defaultKey: "server");
options.Data ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
options.Data ??= new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
options.Data.AddRange(providerOptions);

options.ConnectionString = options.Data.BuildConnectionString(new HashSet<string> { nameof(options.Provider) });
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Configuration/MessageBusOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MessageBusOptions
{
public string? ConnectionString { get; internal set; }
public string? Provider { get; internal set; }
public Dictionary<string, string> Data { get; internal set; } = null!;
public Dictionary<string, string?> Data { get; internal set; } = null!;

public string Scope { get; internal set; } = null!;
public string ScopePrefix { get; internal set; } = null!;
Expand All @@ -29,7 +29,7 @@ public static MessageBusOptions ReadFromConfiguration(IConfiguration config, App
string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null;

var providerOptions = providerConnectionString.ParseConnectionString(defaultKey: "server");
options.Data ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
options.Data ??= new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
options.Data.AddRange(providerOptions);

options.ConnectionString = options.Data.BuildConnectionString(new HashSet<string> { nameof(options.Provider) });
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless.Core/Configuration/MetricOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MetricOptions
{
public string? ConnectionString { get; internal set; }
public string? Provider { get; internal set; }
public Dictionary<string, string> Data { get; internal set; } = null!;
public Dictionary<string, string?> Data { get; internal set; } = null!;

public static MetricOptions ReadFromConfiguration(IConfiguration config)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless.Core/Configuration/QueueOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class QueueOptions
{
public string? ConnectionString { get; internal set; }
public string? Provider { get; internal set; }
public Dictionary<string, string> Data { get; internal set; } = new(StringComparer.OrdinalIgnoreCase);
public Dictionary<string, string?> Data { get; internal set; } = new(StringComparer.OrdinalIgnoreCase);

public string Scope { get; internal set; } = null!;
public string ScopePrefix { get; internal set; } = null!;
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless.Core/Configuration/StorageOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class StorageOptions
{
public string? ConnectionString { get; internal set; }
public string? Provider { get; internal set; }
public Dictionary<string, string> Data { get; internal set; } = new(StringComparer.OrdinalIgnoreCase);
public Dictionary<string, string?> Data { get; internal set; } = new(StringComparer.OrdinalIgnoreCase);

public string Scope { get; internal set; } = null!;
public string ScopePrefix { get; internal set; } = null!;
Expand Down
14 changes: 7 additions & 7 deletions src/Exceptionless.Core/Exceptionless.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
<ItemGroup>
<PackageReference Include="Exceptionless.DateTimeExtensions" Version="6.0.1" />
<PackageReference Include="FluentValidation" Version="12.1.1" />
<PackageReference Include="Foundatio.Extensions.Hosting" Version="13.0.0-beta3.23" />
<PackageReference Include="Foundatio.JsonNet" Version="13.0.0-beta3.23" />
<PackageReference Include="Foundatio.Extensions.Hosting" Version="13.0.0-beta6" />
<PackageReference Include="Foundatio.JsonNet" Version="13.0.0-beta6" />
<PackageReference Include="MiniValidation" Version="0.9.2" />
<PackageReference Include="NEST.JsonNetSerializer" Version="7.17.5" />
<PackageReference Include="Handlebars.Net" Version="2.1.6" />
<PackageReference Include="McSherry.SemanticVersioning" Version="1.4.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.6" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.6" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.6" />
<PackageReference Include="Stripe.net" Version="47.4.0" />
<PackageReference Include="System.DirectoryServices" Version="10.0.5" />
<PackageReference Include="System.DirectoryServices" Version="10.0.6" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Foundatio.Repositories.Elasticsearch" Version="7.18.0-beta4.27" Condition="'$(ReferenceFoundatioRepositoriesSource)' == '' OR '$(ReferenceFoundatioRepositoriesSource)' == 'false'" />
<PackageReference Include="Foundatio.Repositories.Elasticsearch" Version="7.18.0-beta6" Condition="'$(ReferenceFoundatioRepositoriesSource)' == '' OR '$(ReferenceFoundatioRepositoriesSource)' == 'false'" />
<ProjectReference Include="..\..\..\..\Foundatio\Foundatio.Repositories\src\Foundatio.Repositories.Elasticsearch\Foundatio.Repositories.Elasticsearch.csproj" Condition="'$(ReferenceFoundatioRepositoriesSource)' == 'true'" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions src/Exceptionless.Core/Extensions/DictionaryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ public static int GetCollectionHashCode<TValue>(this IDictionary<string, TValue>
return hashCode;
}

public static T? GetValueOrDefault<T>(this IDictionary<string, string> source, string key, T? defaultValue = default)
public static T? GetValueOrDefault<T>(this IDictionary<string, string?> source, string key, T? defaultValue = default)
{
if (!source.ContainsKey(key))
return defaultValue;

object data = source[key];
object? data = source[key];
if (data is T variable)
return variable;

Expand All @@ -162,12 +162,12 @@ public static int GetCollectionHashCode<TValue>(this IDictionary<string, TValue>
return defaultValue;
}

public static string GetString(this IDictionary<string, string> source, string name)
public static string GetString(this IDictionary<string, string?> source, string name)
{
return source.GetString(name, String.Empty);
}

public static string GetString(this IDictionary<string, string> source, string name, string @default)
public static string GetString(this IDictionary<string, string?> source, string name, string @default)
{
if (!source.TryGetValue(name, out string? value) || value is null)
return @default;
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless.Core/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public static class EnumerableExtensions
{
public static IReadOnlyCollection<T> UnionOriginalAndModified<T>(this IReadOnlyCollection<ModifiedDocument<T>> documents) where T : class, new()
{
return documents.Select(d => d.Value).Union(documents.Select(d => d.Original).Where(d => d is not null)).ToList();
return documents.Select(d => d.Value).Union(documents.Select(d => d.Original).OfType<T>()).ToList();
}

public static bool Contains<T>(this IEnumerable<T> enumerable, Func<T, bool> function)
Expand Down
11 changes: 8 additions & 3 deletions src/Exceptionless.Core/Jobs/CleanupDataJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ ILoggerFactory loggerFactory
_cacheClient = cacheClient;
}

protected override Task<ILock> GetLockAsync(CancellationToken cancellationToken = default)
protected override Task<ILock?> GetLockAsync(CancellationToken cancellationToken = default)
{
return _lockProvider.AcquireAsync(nameof(CleanupDataJob), TimeSpan.FromMinutes(15), new CancellationToken(true));
return _lockProvider.AcquireAsync(nameof(CleanupDataJob), TimeSpan.FromMinutes(15), cancellationToken);
}

protected override async Task<JobResult> RunInternalAsync(JobContext context)
Expand Down Expand Up @@ -91,7 +91,12 @@ private async Task MarkTokensSuspended(JobContext context)

do
{
long updatedCount = await _tokenRepository.PatchAllAsync(q => q.Organization(suspendedOrganizations.Hits.Select(o => o.Id)).FieldEquals(t => t.IsSuspended, false), new PartialPatch(new { is_suspended = true }));
// Foundatio Hits can contain null elements, so filter them before accessing properties.
var suspendedOrganizationIds = suspendedOrganizations.Hits
.Where(o => o is not null && o.Id is not null)
.Select(o => o!.Id!)
.ToList();
long updatedCount = await _tokenRepository.PatchAllAsync(q => q.Organization(suspendedOrganizationIds).FieldEquals(t => t.IsSuspended, false), new PartialPatch(new { is_suspended = true }));
if (updatedCount > 0)
_logger.LogInformation("Marking {SuspendedTokenCount} tokens as suspended", updatedCount);
} while (!context.CancellationToken.IsCancellationRequested && await suspendedOrganizations.NextPageAsync());
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Jobs/CleanupOrphanedDataJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ ILoggerFactory loggerFactory
_lockProvider = lockProvider;
}

protected override Task<ILock> GetLockAsync(CancellationToken cancellationToken = default)
protected override Task<ILock?> GetLockAsync(CancellationToken cancellationToken = default)
{
return _lockProvider.AcquireAsync(nameof(CleanupOrphanedDataJob), TimeSpan.FromHours(2), new CancellationToken(true));
return _lockProvider.AcquireAsync(nameof(CleanupOrphanedDataJob), TimeSpan.FromHours(2), cancellationToken);
}

protected override async Task<JobResult> RunInternalAsync(JobContext context)
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Jobs/CloseInactiveSessionsJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ ILoggerFactory loggerFactory
_jsonOptions = jsonOptions;
}

protected override Task<ILock> GetLockAsync(CancellationToken cancellationToken = default)
protected override Task<ILock?> GetLockAsync(CancellationToken cancellationToken = default)
{
return _lockProvider.AcquireAsync(nameof(CloseInactiveSessionsJob), TimeSpan.FromMinutes(15), new CancellationToken(true));
return _lockProvider.AcquireAsync(nameof(CloseInactiveSessionsJob), TimeSpan.FromMinutes(15), cancellationToken);
}

protected override async Task<JobResult> RunInternalAsync(JobContext context)
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Jobs/DailySummaryJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ ILoggerFactory loggerFactory
_lockProvider = new ThrottlingLockProvider(cacheClient, 1, TimeSpan.FromHours(1), timeProvider, resiliencePolicyProvider, loggerFactory);
}

protected override Task<ILock> GetLockAsync(CancellationToken cancellationToken = default)
protected override Task<ILock?> GetLockAsync(CancellationToken cancellationToken = default)
{
return _lockProvider.AcquireAsync(nameof(DailySummaryJob), TimeSpan.FromHours(1), new CancellationToken(true));
return _lockProvider.AcquireAsync(nameof(DailySummaryJob), TimeSpan.FromHours(1), cancellationToken);
}

protected override async Task<JobResult> RunInternalAsync(JobContext context)
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Jobs/DownloadGeoIPDatabaseJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ ILoggerFactory loggerFactory
_lockProvider = new ThrottlingLockProvider(cacheClient, 1, TimeSpan.FromDays(1), timeProvider, resiliencePolicyProvider, loggerFactory);
}

protected override Task<ILock> GetLockAsync(CancellationToken cancellationToken = default)
protected override Task<ILock?> GetLockAsync(CancellationToken cancellationToken = default)
{
return _lockProvider.AcquireAsync(nameof(DownloadGeoIPDatabaseJob), TimeSpan.FromHours(2), new CancellationToken(true));
return _lockProvider.AcquireAsync(nameof(DownloadGeoIPDatabaseJob), TimeSpan.FromHours(2), cancellationToken);
}

protected override async Task<JobResult> RunInternalAsync(JobContext context)
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless.Core/Jobs/Elastic/DataMigrationJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected override async Task<JobResult> RunInternalAsync(JobContext context)
var status = taskStatus?.Task?.Status;
if (taskStatus?.Task is null || status is null)
{
_logger.LogWarning(taskStatus?.OriginalException, "Error getting task status for {TargetIndex} {TaskId}: {Message}", workItem.TargetIndex, workItem.TaskId, taskStatus.GetErrorMessage());
_logger.LogWarning(taskStatus?.OriginalException, "Error getting task status for {TargetIndex} {TaskId}: {Message}", workItem.TargetIndex, workItem.TaskId, taskStatus?.GetErrorMessage());
if (taskStatus?.ServerError?.Status == 429)
await Task.Delay(TimeSpan.FromSeconds(1), _timeProvider);

Expand Down
3 changes: 2 additions & 1 deletion src/Exceptionless.Core/Jobs/EventNotificationsJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public EventNotificationsJob(IQueue<EventNotification> queue,

protected override async Task<JobResult> ProcessQueueEntryAsync(QueueEntryContext<EventNotification> context)
{
var wi = context.QueueEntry.Value;
var wi = context.QueueEntry.Value!;

var ev = await _eventRepository.GetByIdAsync(wi.EventId);
if (ev is null)
return JobResult.SuccessWithMessage($"Could not load event: {wi.EventId}");
Expand Down
18 changes: 11 additions & 7 deletions src/Exceptionless.Core/Jobs/EventPostsJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Comment thread
niemyjski marked this conversation as resolved.
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.");
}
Expand Down Expand Up @@ -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);
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this catch/logging path, queueEntry.Value!.FilePath can throw if the queue entry value is null (which is exactly when you most want logging to succeed). Consider using a null-safe access with a fallback (e.g., log the queue id and payloadPath/ep.FilePath instead) so the original exception isn’t masked by a new NullReferenceException.

Suggested change
_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);

Copilot uses AI. Check for mistakes.
}

AppDiagnostics.EventsRetryErrors.Add(1);
Expand All @@ -335,12 +339,12 @@ private Task AbandonEntryAsync(IQueueEntry<EventPost> queueEntry)
return AppDiagnostics.PostsAbandonTime.TimeAsync(queueEntry.AbandonAsync);
}

private Task CompleteEntryAsync(IQueueEntry<EventPost> entry, EventPostInfo eventPostInfo, DateTime created)
private Task CompleteEntryAsync(IQueueEntry<EventPost> entry, EventPost eventPost, DateTime created)
{
Comment thread
niemyjski marked this conversation as resolved.
return AppDiagnostics.PostsCompleteTime.TimeAsync(async () =>
{
await entry.CompleteAsync();
await _eventPostService.CompleteEventPostAsync(entry.Value.FilePath, eventPostInfo.ProjectId, created, entry.Value.ShouldArchive);
await _eventPostService.CompleteEventPostAsync(eventPost.FilePath, eventPost.ProjectId, created, eventPost.ShouldArchive);
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/Exceptionless.Core/Jobs/EventUsageJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ ILoggerFactory loggerFactory
_lockProvider = lockProvider;
}

protected override Task<ILock> GetLockAsync(CancellationToken cancellationToken = default)
protected override Task<ILock?> GetLockAsync(CancellationToken cancellationToken = default)
{
return _lockProvider.AcquireAsync(nameof(EventUsageJob), TimeSpan.FromMinutes(4), new CancellationToken(true));
return _lockProvider.AcquireAsync(nameof(EventUsageJob), TimeSpan.FromMinutes(4), cancellationToken);
}

protected override async Task<JobResult> RunInternalAsync(JobContext context)
Expand Down
Loading
Loading