Commit 3cb24090 authored by Savorboard's avatar Savorboard

bug fix.

parent 050e71f5
...@@ -4,6 +4,7 @@ using System.Threading.Tasks; ...@@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Dapper; using Dapper;
using DotNetCore.CAP.Processor; using DotNetCore.CAP.Processor;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using MySql.Data.MySqlClient;
namespace DotNetCore.CAP.MySql namespace DotNetCore.CAP.MySql
{ {
...@@ -41,7 +42,7 @@ namespace DotNetCore.CAP.MySql ...@@ -41,7 +42,7 @@ namespace DotNetCore.CAP.MySql
var removedCount = 0; var removedCount = 0;
do do
{ {
using (var connection = new SqlConnection(_options.ConnectionString)) using (var connection = new MySqlConnection(_options.ConnectionString))
{ {
removedCount = await connection.ExecuteAsync($@"DELETE FROM `{table}` WHERE ExpiresAt < @now limit @count;", removedCount = await connection.ExecuteAsync($@"DELETE FROM `{table}` WHERE ExpiresAt < @now limit @count;",
new { now = DateTime.Now, count = MaxBatch }); new { now = DateTime.Now, count = MaxBatch });
......
...@@ -26,6 +26,7 @@ namespace DotNetCore.CAP.MySql ...@@ -26,6 +26,7 @@ namespace DotNetCore.CAP.MySql
{ {
await connection.ExecuteAsync(sql); await connection.ExecuteAsync(sql);
} }
_logger.LogDebug("Ensuring all create database tables script are applied."); _logger.LogDebug("Ensuring all create database tables script are applied.");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment