diff --git a/src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs b/src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs index 335e4c7..cc77501 100644 --- a/src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs +++ b/src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Dapper; using DotNetCore.CAP.Processor; using Microsoft.Extensions.Logging; +using MySql.Data.MySqlClient; namespace DotNetCore.CAP.MySql { @@ -41,7 +42,7 @@ namespace DotNetCore.CAP.MySql var removedCount = 0; 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;", new { now = DateTime.Now, count = MaxBatch }); diff --git a/src/DotNetCore.CAP.MySql/MySqlStorage.cs b/src/DotNetCore.CAP.MySql/MySqlStorage.cs index 0db4fda..9813d0f 100644 --- a/src/DotNetCore.CAP.MySql/MySqlStorage.cs +++ b/src/DotNetCore.CAP.MySql/MySqlStorage.cs @@ -26,6 +26,7 @@ namespace DotNetCore.CAP.MySql { await connection.ExecuteAsync(sql); } + _logger.LogDebug("Ensuring all create database tables script are applied."); }