소스 검색

cleanup code.

master
yangxiaodong 7 년 전
부모
커밋
926769d354
25개의 변경된 파일19개의 추가작업 그리고 32개의 파일을 삭제
  1. +1
    -1
      src/DotNetCore.CAP.Kafka/CAP.KafkaCapOptionsExtension.cs
  2. +0
    -1
      src/DotNetCore.CAP.Kafka/PublishQueueExecutor.cs
  3. +1
    -1
      src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
  4. +0
    -1
      src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs
  5. +0
    -1
      src/DotNetCore.CAP.MySql/MySqlStorage.cs
  6. +2
    -2
      src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs
  7. +1
    -0
      src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
  8. +1
    -1
      src/DotNetCore.CAP.SqlServer/CapPublisher.cs
  9. +1
    -1
      src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs
  10. +0
    -1
      src/DotNetCore.CAP/Abstractions/ConsumerContext.cs
  11. +1
    -1
      src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs
  12. +1
    -2
      src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs
  13. +1
    -0
      src/DotNetCore.CAP/IStorageConnection.cs
  14. +1
    -3
      src/DotNetCore.CAP/Infrastructure/WebHookProvider.cs
  15. +0
    -2
      src/DotNetCore.CAP/Internal/ConsumerInvokerFactory.cs
  16. +1
    -1
      src/DotNetCore.CAP/Internal/HashCodeCombiner.cs
  17. +1
    -1
      src/DotNetCore.CAP/Internal/IConsumerInvoker.Default.cs
  18. +0
    -1
      src/DotNetCore.CAP/Internal/IModelBinder.ComplexType.cs
  19. +1
    -1
      src/DotNetCore.CAP/Internal/IModelBinder.SimpleType.cs
  20. +1
    -1
      src/DotNetCore.CAP/Internal/IModelBinderFactory.cs
  21. +0
    -1
      src/DotNetCore.CAP/Models/CapPublishedMessage.cs
  22. +0
    -1
      src/DotNetCore.CAP/Models/CapReceivedMessage.cs
  23. +1
    -1
      src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs
  24. +1
    -4
      src/DotNetCore.CAP/Processor/IProcessor.FailedJob.cs
  25. +2
    -2
      src/DotNetCore.CAP/QueueExecutorFactory.cs

+ 1
- 1
src/DotNetCore.CAP.Kafka/CAP.KafkaCapOptionsExtension.cs 파일 보기

@@ -21,7 +21,7 @@ namespace DotNetCore.CAP
var kafkaOptions = new KafkaOptions();
_configure(kafkaOptions);
services.AddSingleton(kafkaOptions);
services.AddSingleton<IConsumerClientFactory, KafkaConsumerClientFactory>();
services.AddTransient<IQueueExecutor, PublishQueueExecutor>();
}


+ 0
- 1
src/DotNetCore.CAP.Kafka/PublishQueueExecutor.cs 파일 보기

@@ -2,7 +2,6 @@
using System.Text;
using System.Threading.Tasks;
using Confluent.Kafka;
using Confluent.Kafka.Serialization;
using DotNetCore.CAP.Processor.States;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;


+ 1
- 1
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs 파일 보기

@@ -1,6 +1,6 @@
using System;
using DotNetCore.CAP.Processor;
using DotNetCore.CAP.MySql;
using DotNetCore.CAP.Processor;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;



+ 0
- 1
src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs 파일 보기

@@ -1,5 +1,4 @@
using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Dapper;
using DotNetCore.CAP.Processor;


+ 0
- 1
src/DotNetCore.CAP.MySql/MySqlStorage.cs 파일 보기

@@ -1,4 +1,3 @@
using System.Data.SqlClient;
using System.Threading;
using System.Threading.Tasks;
using Dapper;


+ 2
- 2
src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs 파일 보기

@@ -46,7 +46,7 @@ namespace DotNetCore.CAP.MySql
//SELECT MessageId,MessageType FROM `{_prefix}.queue` LIMIT 1 FOR UPDATE;
//DELETE FROM `{_prefix}.queue` LIMIT 1;
//COMMIT;
var sql = $@"
SELECT `MessageId`,`MessageType` FROM `{_prefix}.queue` LIMIT 1 FOR UPDATE;
DELETE FROM `{_prefix}.queue` LIMIT 1;";
@@ -123,7 +123,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";

private async Task<IFetchedMessage> FetchNextMessageCoreAsync(string sql, object args = null)
{
//here don't use `using` to dispose
//here don't use `using` to dispose
var connection = new MySqlConnection(_options.ConnectionString);
await connection.OpenAsync();
var transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);


+ 1
- 0
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs 파일 보기

@@ -19,6 +19,7 @@ namespace DotNetCore.CAP.RabbitMQ
private ulong _deliveryTag;

public event EventHandler<MessageContext> OnMessageReceieved;

public event EventHandler<string> OnError;

public RabbitMQConsumerClient(string queueName, RabbitMQOptions options)


+ 1
- 1
src/DotNetCore.CAP.SqlServer/CapPublisher.cs 파일 보기

@@ -55,7 +55,7 @@ namespace DotNetCore.CAP.SqlServer

return PublishCoreAsync(name, content);
}
public void Publish<T>(string name, T contentObj, IDbConnection dbConnection, IDbTransaction dbTransaction = null)
{
CheckIsAdoNet(name);


+ 1
- 1
src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs 파일 보기

@@ -114,7 +114,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";

private async Task<IFetchedMessage> FetchNextMessageCoreAsync(string sql, object args = null)
{
//here don't use `using` to dispose
//here don't use `using` to dispose
var connection = new SqlConnection(_options.ConnectionString);
await connection.OpenAsync();
var transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);


+ 0
- 1
src/DotNetCore.CAP/Abstractions/ConsumerContext.cs 파일 보기

@@ -1,5 +1,4 @@
using System;
using DotNetCore.CAP.Infrastructure;

namespace DotNetCore.CAP.Abstractions
{


+ 1
- 1
src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs 파일 보기

@@ -102,4 +102,4 @@ namespace DotNetCore.CAP.Abstractions.ModelBinding
return !x.Equals(y);
}
}
}
}

+ 1
- 2
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs 파일 보기

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Reflection;
using DotNetCore.CAP;
using DotNetCore.CAP.Abstractions;
using DotNetCore.CAP.Abstractions.ModelBinding;
using DotNetCore.CAP.Infrastructure;
using DotNetCore.CAP.Internal;
using DotNetCore.CAP.Processor;
@@ -60,7 +59,7 @@ namespace Microsoft.Extensions.DependencyInjection
foreach (var serviceExtension in options.Extensions)
{
serviceExtension.AddServices(services);
}
}
services.AddSingleton(options);

return new CapBuilder(services);


+ 1
- 0
src/DotNetCore.CAP/IStorageConnection.cs 파일 보기

@@ -56,6 +56,7 @@ namespace DotNetCore.CAP
/// Returns executed failed message.
/// </summary>
Task<IEnumerable<CapReceivedMessage>> GetFailedReceviedMessages();

//-----------------------------------------

/// <summary>


+ 1
- 3
src/DotNetCore.CAP/Infrastructure/WebHookProvider.cs 파일 보기

@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace DotNetCore.CAP.Infrastructure
{
@@ -11,4 +9,4 @@ namespace DotNetCore.CAP.Infrastructure
throw new NotImplementedException();
}
}
}
}

+ 0
- 2
src/DotNetCore.CAP/Internal/ConsumerInvokerFactory.cs 파일 보기

@@ -1,7 +1,5 @@
using System;
using DotNetCore.CAP.Abstractions;
using DotNetCore.CAP.Abstractions.ModelBinding;
using DotNetCore.CAP.Infrastructure;
using Microsoft.Extensions.Logging;

namespace DotNetCore.CAP.Internal


+ 1
- 1
src/DotNetCore.CAP/Internal/HashCodeCombiner.cs 파일 보기

@@ -78,4 +78,4 @@ namespace DotNetCore.CAP.Internal
return new HashCodeCombiner(0x1505L);
}
}
}
}

+ 1
- 1
src/DotNetCore.CAP/Internal/IConsumerInvoker.Default.cs 파일 보기

@@ -57,7 +57,7 @@ namespace DotNetCore.CAP.Internal
catch (FormatException ex)
{
_logger.ModelBinderFormattingException(_executor.MethodInfo?.Name, firstParameter.Name, value, ex);
}
}
}
else
{


+ 0
- 1
src/DotNetCore.CAP/Internal/IModelBinder.ComplexType.cs 파일 보기

@@ -26,7 +26,6 @@ namespace DotNetCore.CAP.Internal
catch (Exception)
{
return Task.FromResult(ModelBindingResult.Failed());

}
}
}

+ 1
- 1
src/DotNetCore.CAP/Internal/IModelBinder.SimpleType.cs 파일 보기

@@ -83,4 +83,4 @@ namespace DotNetCore.CAP.Internal
return !type.GetTypeInfo().IsValueType || isNullableValueType;
}
}
}
}

+ 1
- 1
src/DotNetCore.CAP/Internal/IModelBinderFactory.cs 파일 보기

@@ -7,4 +7,4 @@ namespace DotNetCore.CAP.Internal
{
IModelBinder CreateBinder(ParameterInfo parameter);
}
}
}

+ 0
- 1
src/DotNetCore.CAP/Models/CapPublishedMessage.cs 파일 보기

@@ -1,5 +1,4 @@
using System;
using DotNetCore.CAP.Infrastructure;

namespace DotNetCore.CAP.Models
{


+ 0
- 1
src/DotNetCore.CAP/Models/CapReceivedMessage.cs 파일 보기

@@ -1,5 +1,4 @@
using System;
using DotNetCore.CAP.Infrastructure;

namespace DotNetCore.CAP.Models
{


+ 1
- 1
src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs 파일 보기

@@ -61,7 +61,7 @@ namespace DotNetCore.CAP.Processor

_logger.LogTrace("Pulsing the Queuer.");

PublishQueuer.PulseEvent.Set();
PublishQueuer.PulseEvent.Set();
}

public void Dispose()


+ 1
- 4
src/DotNetCore.CAP/Processor/IProcessor.FailedJob.cs 파일 보기

@@ -1,7 +1,4 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using DotNetCore.CAP.Processor.States;
using Microsoft.Extensions.DependencyInjection;
@@ -83,4 +80,4 @@ namespace DotNetCore.CAP.Processor
}
}
}
}
}

+ 2
- 2
src/DotNetCore.CAP/QueueExecutorFactory.cs 파일 보기

@@ -18,8 +18,8 @@ namespace DotNetCore.CAP
{
var queueExectors = _serviceProvider.GetServices<IQueueExecutor>();

return messageType == MessageType.Publish
? queueExectors.FirstOrDefault(x => x is BasePublishQueueExecutor)
return messageType == MessageType.Publish
? queueExectors.FirstOrDefault(x => x is BasePublishQueueExecutor)
: queueExectors.FirstOrDefault(x => !(x is BasePublishQueueExecutor));
}
}

불러오는 중...
취소
저장