Skip to content

Commit

Permalink
Merge pull request #296 from Particular/hotfix-4.1.1
Browse files Browse the repository at this point in the history
fix outbox diagnostics
  • Loading branch information
tmasternak authored May 28, 2018
2 parents 64209d9 + 4200177 commit 64980e2
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/SqlPersistence/Outbox/SqlOutboxFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ protected override void Setup(FeatureConfigurationContext context)
return;
}

context.RegisterStartupTask(b =>
{
var frequencyToRunCleanup = settings.GetOrDefault<TimeSpan?>(FrequencyToRunDeduplicationDataCleanup) ?? TimeSpan.FromMinutes(1);
var timeToKeepDeduplicationData = settings.GetOrDefault<TimeSpan?>(TimeToKeepDeduplicationData) ?? TimeSpan.FromDays(7);
var frequencyToRunCleanup = settings.GetOrDefault<TimeSpan?>(FrequencyToRunDeduplicationDataCleanup) ?? TimeSpan.FromMinutes(1);
var timeToKeepDeduplicationData = settings.GetOrDefault<TimeSpan?>(TimeToKeepDeduplicationData) ?? TimeSpan.FromDays(7);

settings.AddStartupDiagnosticsSection("NServiceBus.Persistence.Sql.Outbox", new
{
CleanupDisabled = false,
TimeToKeepDeduplicationData = timeToKeepDeduplicationData,
FrequencyToRunDeduplicationDataCleanup = frequencyToRunCleanup
});

return new OutboxCleaner(outboxPersister.RemoveEntriesOlderThan, b.Build<CriticalError>().Raise, timeToKeepDeduplicationData, frequencyToRunCleanup, new AsyncTimer());
settings.AddStartupDiagnosticsSection("NServiceBus.Persistence.Sql.Outbox", new
{
CleanupDisabled = false,
TimeToKeepDeduplicationData = timeToKeepDeduplicationData,
FrequencyToRunDeduplicationDataCleanup = frequencyToRunCleanup
});

context.RegisterStartupTask(b =>
new OutboxCleaner(outboxPersister.RemoveEntriesOlderThan, b.Build<CriticalError>().Raise, timeToKeepDeduplicationData, frequencyToRunCleanup, new AsyncTimer()));
}

internal const string TimeToKeepDeduplicationData = "Persistence.Sql.Outbox.TimeToKeepDeduplicationData";
Expand Down

0 comments on commit 64980e2

Please sign in to comment.