Просмотр исходного кода

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

master
Savorboard 6 лет назад
Родитель
Сommit
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}')";



Загрузка…
Отмена
Сохранить