Преглед изворни кода

Fixed DateTime localization format conversion error to sql.(#139)

master
Savorboard пре 6 година
родитељ
комит
9caf7a2308
3 измењених фајлова са 3 додато и 3 уклоњено
  1. +1
    -1
      src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs
  2. +1
    -1
      src/DotNetCore.CAP.PostgreSql/PostgreSqlStorageConnection.cs
  3. +1
    -1
      src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs

+ 1
- 1
src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs Прегледај датотеку

@@ -80,7 +80,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);SELECT LAST

public async Task<IEnumerable<CapReceivedMessage>> GetReceivedMessagesOfNeedRetry()
{
var fourMinsAgo = DateTime.Now.AddMinutes(-4);
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O");
var sql =
$"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))


+ 1
- 1
src/DotNetCore.CAP.PostgreSql/PostgreSqlStorageConnection.cs Прегледај датотеку

@@ -77,7 +77,7 @@ namespace DotNetCore.CAP.PostgreSql

public async Task<IEnumerable<CapReceivedMessage>> GetReceivedMessagesOfNeedRetry()
{
var fourMinsAgo = DateTime.Now.AddMinutes(-4);
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O");
var sql =
$"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))


+ 1
- 1
src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs Прегледај датотеку

@@ -40,7 +40,7 @@ namespace DotNetCore.CAP.SqlServer

public async Task<IEnumerable<CapPublishedMessage>> GetPublishedMessagesOfNeedRetry()
{
var fourMinsAgo = DateTime.Now.AddMinutes(-4);
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O");
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}')";



Loading…
Откажи
Сачувај