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

fixed thread conflict issue when sending messages with PublishAsync. #80

master
Savorboard 6 лет назад
Родитель
Сommit
ccd72ce2db
3 измененных файлов: 6 добавлений и 12 удалений
  1. +2
    -4
      src/DotNetCore.CAP.MySql/CapPublisher.cs
  2. +2
    -4
      src/DotNetCore.CAP.PostgreSql/CapPublisher.cs
  3. +2
    -4
      src/DotNetCore.CAP.SqlServer/CapPublisher.cs

+ 2
- 4
src/DotNetCore.CAP.MySql/CapPublisher.cs Просмотреть файл

@@ -62,14 +62,12 @@ namespace DotNetCore.CAP.MySql
_logger.LogInformation("Published Message has been persisted in the database. name:" + message);
}

protected override Task ExecuteAsync(IDbConnection dbConnection, IDbTransaction dbTransaction,
protected override async Task ExecuteAsync(IDbConnection dbConnection, IDbTransaction dbTransaction,
CapPublishedMessage message)
{
dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);
await dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);

_logger.LogInformation("Published Message has been persisted in the database. name:" + message);

return Task.CompletedTask;
}

#region private methods


+ 2
- 4
src/DotNetCore.CAP.PostgreSql/CapPublisher.cs Просмотреть файл

@@ -64,14 +64,12 @@ namespace DotNetCore.CAP.PostgreSql
_logger.LogInformation("Published Message has been persisted in the database. name:" + message);
}

protected override Task ExecuteAsync(IDbConnection dbConnection, IDbTransaction dbTransaction,
protected override async Task ExecuteAsync(IDbConnection dbConnection, IDbTransaction dbTransaction,
CapPublishedMessage message)
{
dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);
await dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);

_logger.LogInformation("Published Message has been persisted in the database. name:" + message);

return Task.CompletedTask;
}

#region private methods


+ 2
- 4
src/DotNetCore.CAP.SqlServer/CapPublisher.cs Просмотреть файл

@@ -63,14 +63,12 @@ namespace DotNetCore.CAP.SqlServer
_logger.LogInformation("published message has been persisted to the database. name:" + message);
}

protected override Task ExecuteAsync(IDbConnection dbConnection, IDbTransaction dbTransaction,
protected override async Task ExecuteAsync(IDbConnection dbConnection, IDbTransaction dbTransaction,
CapPublishedMessage message)
{
dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);
await dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);

_logger.LogInformation("published message has been persisted to the database. name:" + message);

return Task.CompletedTask;
}

#region private methods


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