|
|
@@ -10,7 +10,7 @@ using Npgsql; |
|
|
|
|
|
|
|
namespace DotNetCore.CAP.PostgreSql |
|
|
|
{ |
|
|
|
internal class DefaultAdditionalProcessor : IAdditionalProcessor |
|
|
|
internal class PostgreSqlCollectProcessor : ICollectProcessor |
|
|
|
{ |
|
|
|
private const int MaxBatch = 1000; |
|
|
|
|
|
|
@@ -24,7 +24,7 @@ namespace DotNetCore.CAP.PostgreSql |
|
|
|
private readonly PostgreSqlOptions _options; |
|
|
|
private readonly TimeSpan _waitingInterval = TimeSpan.FromMinutes(5); |
|
|
|
|
|
|
|
public DefaultAdditionalProcessor(ILogger<DefaultAdditionalProcessor> logger, |
|
|
|
public PostgreSqlCollectProcessor(ILogger<PostgreSqlCollectProcessor> logger, |
|
|
|
PostgreSqlOptions sqlServerOptions) |
|
|
|
{ |
|
|
|
_logger = logger; |
|
|
@@ -33,10 +33,10 @@ namespace DotNetCore.CAP.PostgreSql |
|
|
|
|
|
|
|
public async Task ProcessAsync(ProcessingContext context) |
|
|
|
{ |
|
|
|
_logger.LogDebug("Collecting expired entities."); |
|
|
|
|
|
|
|
foreach (var table in Tables) |
|
|
|
{ |
|
|
|
_logger.LogDebug($"Collecting expired data from table [{_options.Schema}].[{table}]."); |
|
|
|
|
|
|
|
var removedCount = 0; |
|
|
|
do |
|
|
|
{ |