Procházet zdrojové kódy

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

master
Savorboard před 6 roky
rodič
revize
c5bd4c174f
3 změnil soubory, kde provedl 3 přidání a 3 odebrání
  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 Zobrazit soubor

@@ -42,7 +42,7 @@ namespace DotNetCore.CAP.MySql

public async Task<IEnumerable<CapPublishedMessage>> GetPublishedMessagesOfNeedRetry()
{
var fourMinsAgo = DateTime.Now.AddMinutes(-4);
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O");
var sql =
$"SELECT * FROM `{_prefix}.published` WHERE `Retries`<{_capOptions.FailedRetryCount} AND `Added`<'{fourMinsAgo}' AND (`StatusName` = '{StatusName.Failed}' OR `StatusName` = '{StatusName.Scheduled}') LIMIT 200;";



+ 1
- 1
src/DotNetCore.CAP.PostgreSql/PostgreSqlStorageConnection.cs Zobrazit soubor

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

public async Task<IEnumerable<CapPublishedMessage>> GetPublishedMessagesOfNeedRetry()
{
var fourMinsAgo = DateTime.Now.AddMinutes(-4);
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O");
var sql =
$"SELECT * FROM \"{Options.Schema}\".\"published\" WHERE \"Retries\"<{_capOptions.FailedRetryCount} AND \"Added\"<'{fourMinsAgo}' AND (\"StatusName\"='{StatusName.Failed}' OR \"StatusName\"='{StatusName.Scheduled}') LIMIT 200;";



+ 1
- 1
src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs Zobrazit soubor

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

public async Task<IEnumerable<CapReceivedMessage>> GetReceivedMessagesOfNeedRetry()
{
var fourMinsAgo = DateTime.Now.AddMinutes(-4);
var fourMinsAgo = DateTime.Now.AddMinutes(-4).ToString("O");
var sql =
$"SELECT TOP (200) * FROM [{Options.Schema}].[Received] WITH (readpast) WHERE Retries<{_capOptions.FailedRetryCount} AND Added<'{fourMinsAgo}' AND (StatusName = '{StatusName.Failed}' OR StatusName = '{StatusName.Scheduled}')";
using (var connection = new SqlConnection(Options.ConnectionString))


Načítá se…
Zrušit
Uložit