Ver a proveniência

refactor code

master
Savorboard há 6 anos
ascendente
cometimento
82e43964d3
4 ficheiros alterados com 2 adições e 8 eliminações
  1. +1
    -1
      src/DotNetCore.CAP.MySql/CapPublisher.cs
  2. +0
    -5
      src/DotNetCore.CAP.MySql/MySqlStorageTransaction.cs
  3. +1
    -1
      src/DotNetCore.CAP/IConsumerHandler.Default.cs
  4. +0
    -1
      src/DotNetCore.CAP/Models/CapReceivedMessage.cs

+ 1
- 1
src/DotNetCore.CAP.MySql/CapPublisher.cs Ver ficheiro

@@ -73,7 +73,7 @@ namespace DotNetCore.CAP.MySql
private string PrepareSql()
{
return
$"INSERT INTO `{_options.TableNamePrefix}.published` (`Name`,`Content`,`Retries`,`Added`,`ExpiresAt`,`StatusName`)VALUES(@Name,@Content,@Retries,@Added,@ExpiresAt,@StatusName);SELECT LAST_INSERT_ID()";
$"INSERT INTO `{_options.TableNamePrefix}.published` (`Id`,`Name`,`Content`,`Retries`,`Added`,`ExpiresAt`,`StatusName`)VALUES(@Id,@Name,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
}

private IDbTransaction InitDbConnection()


+ 0
- 5
src/DotNetCore.CAP.MySql/MySqlStorageTransaction.cs Ver ficheiro

@@ -14,7 +14,6 @@ namespace DotNetCore.CAP.MySql
{
private readonly IDbConnection _dbConnection;

//private readonly IDbTransaction _dbTransaction;
private readonly string _prefix;

public MySqlStorageTransaction(MySqlStorageConnection connection)
@@ -23,8 +22,6 @@ namespace DotNetCore.CAP.MySql
_prefix = options.TableNamePrefix;

_dbConnection = new MySqlConnection(options.ConnectionString);
// _dbConnection.Open(); for performance
// _dbTransaction = _dbConnection.BeginTransaction(IsolationLevel.ReadCommitted);
}

public void UpdateMessage(CapPublishedMessage message)
@@ -55,13 +52,11 @@ namespace DotNetCore.CAP.MySql
{
_dbConnection.Close();
_dbConnection.Dispose();
//_dbTransaction.Commit();
return Task.CompletedTask;
}

public void Dispose()
{
//_dbTransaction.Dispose();
_dbConnection.Dispose();
}
}

+ 1
- 1
src/DotNetCore.CAP/IConsumerHandler.Default.cs Ver ficheiro

@@ -171,7 +171,7 @@ namespace DotNetCore.CAP

private void StoreMessage(CapReceivedMessage receivedMessage)
{
_connection.StoreReceivedMessageAsync(receivedMessage).GetAwaiter().GetResult();
_connection.StoreReceivedMessage(receivedMessage);
}

private (Guid, string) TracingBefore(string topic, string values)


+ 0
- 1
src/DotNetCore.CAP/Models/CapReceivedMessage.cs Ver ficheiro

@@ -2,7 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using DotNetCore.CAP.Infrastructure;

namespace DotNetCore.CAP.Models
{


Carregando…
Cancelar
Guardar