@@ -80,7 +80,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);SELECT LAST | |||||
public async Task<IEnumerable<CapReceivedMessage>> GetReceivedMessagesOfNeedRetry() | public async Task<IEnumerable<CapReceivedMessage>> GetReceivedMessagesOfNeedRetry() | ||||
{ | { | ||||
var fourMinsAgo = DateTime.Now.AddMinutes(-4); | |||||
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O"); | |||||
var sql = | var sql = | ||||
$"SELECT * FROM `{_prefix}.received` WHERE `Retries`<{_capOptions.FailedRetryCount} AND `Added`<'{fourMinsAgo}' AND (`StatusName` = '{StatusName.Failed}' OR `StatusName` = '{StatusName.Scheduled}') LIMIT 200;"; | $"SELECT * FROM `{_prefix}.received` WHERE `Retries`<{_capOptions.FailedRetryCount} AND `Added`<'{fourMinsAgo}' AND (`StatusName` = '{StatusName.Failed}' OR `StatusName` = '{StatusName.Scheduled}') LIMIT 200;"; | ||||
using (var connection = new MySqlConnection(Options.ConnectionString)) | using (var connection = new MySqlConnection(Options.ConnectionString)) | ||||
@@ -77,7 +77,7 @@ namespace DotNetCore.CAP.PostgreSql | |||||
public async Task<IEnumerable<CapReceivedMessage>> GetReceivedMessagesOfNeedRetry() | public async Task<IEnumerable<CapReceivedMessage>> GetReceivedMessagesOfNeedRetry() | ||||
{ | { | ||||
var fourMinsAgo = DateTime.Now.AddMinutes(-4); | |||||
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O"); | |||||
var sql = | var sql = | ||||
$"SELECT * FROM \"{Options.Schema}\".\"received\" WHERE \"Retries\"<{_capOptions.FailedRetryCount} AND \"Added\"<'{fourMinsAgo}' AND (\"StatusName\"='{StatusName.Failed}' OR \"StatusName\"='{StatusName.Scheduled}') LIMIT 200;"; | $"SELECT * FROM \"{Options.Schema}\".\"received\" WHERE \"Retries\"<{_capOptions.FailedRetryCount} AND \"Added\"<'{fourMinsAgo}' AND (\"StatusName\"='{StatusName.Failed}' OR \"StatusName\"='{StatusName.Scheduled}') LIMIT 200;"; | ||||
using (var connection = new NpgsqlConnection(Options.ConnectionString)) | using (var connection = new NpgsqlConnection(Options.ConnectionString)) | ||||
@@ -40,7 +40,7 @@ namespace DotNetCore.CAP.SqlServer | |||||
public async Task<IEnumerable<CapPublishedMessage>> GetPublishedMessagesOfNeedRetry() | public async Task<IEnumerable<CapPublishedMessage>> GetPublishedMessagesOfNeedRetry() | ||||
{ | { | ||||
var fourMinsAgo = DateTime.Now.AddMinutes(-4); | |||||
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O"); | |||||
var sql = | var sql = | ||||
$"SELECT TOP (200) * FROM [{Options.Schema}].[Published] WITH (readpast) WHERE Retries<{_capOptions.FailedRetryCount} AND Added<'{fourMinsAgo}' AND (StatusName = '{StatusName.Failed}' OR StatusName = '{StatusName.Scheduled}')"; | $"SELECT TOP (200) * FROM [{Options.Schema}].[Published] WITH (readpast) WHERE Retries<{_capOptions.FailedRetryCount} AND Added<'{fourMinsAgo}' AND (StatusName = '{StatusName.Failed}' OR StatusName = '{StatusName.Scheduled}')"; | ||||