From 2b90afd9e812100413e520acedb9c71666fce89c Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 6 Oct 2017 22:13:58 +0800 Subject: [PATCH] cleanup code. --- .../DotNetCore.CAP.MySql.csproj | 2 +- .../ModelBinding/ModelBindingResult.cs | 2 +- src/DotNetCore.CAP/CapCache.cs | 2 + .../Dashboard/Content/resx/Strings.zh.resx | 45 ------------------- src/DotNetCore.CAP/DotNetCore.CAP.csproj | 9 +--- src/DotNetCore.CAP/Infrastructure/ObjectId.cs | 2 +- src/DotNetCore.CAP/Models/CapMessageDto.cs | 1 + .../INodeDiscoveryProvider.Consul.cs | 4 +- .../Processor/States/IState.Succeeded.cs | 4 +- 9 files changed, 12 insertions(+), 59 deletions(-) diff --git a/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj b/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj index 00ab5c2..4a580e8 100644 --- a/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj +++ b/src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs b/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs index c1796d9..0a23d2b 100644 --- a/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs +++ b/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs @@ -43,7 +43,7 @@ namespace DotNetCore.CAP.Abstractions.ModelBinding { if (IsSuccess) return $"Success '{Model}'"; - return $"Failed"; + return "Failed"; } public override bool Equals(object obj) diff --git a/src/DotNetCore.CAP/CapCache.cs b/src/DotNetCore.CAP/CapCache.cs index 9483ce8..8bb55f6 100644 --- a/src/DotNetCore.CAP/CapCache.cs +++ b/src/DotNetCore.CAP/CapCache.cs @@ -13,6 +13,8 @@ namespace DotNetCore.CAP /// Cache is thread safe and will delete expired entries on its own using System.Threading.Timers (which run on /// threads). /// + // ReSharper disable once InheritdocConsiderUsage + // ReSharper disable once InconsistentNaming public class Cache : IDisposable { #region Constructor and class members diff --git a/src/DotNetCore.CAP/Dashboard/Content/resx/Strings.zh.resx b/src/DotNetCore.CAP/Dashboard/Content/resx/Strings.zh.resx index b814c28..41e82cc 100644 --- a/src/DotNetCore.CAP/Dashboard/Content/resx/Strings.zh.resx +++ b/src/DotNetCore.CAP/Dashboard/Content/resx/Strings.zh.resx @@ -150,9 +150,6 @@ 更多... - - N/A - @@ -213,27 +210,6 @@ 每页条数 - - 没有作业 - - - 队列中不存在。尝试添加作业到队列 - - - 长度 - - - 下一个作业 - - - 队列 - - - 队列 - - - 没有活动服务器。后台作业将不会被执行。 - 心跳 @@ -276,36 +252,18 @@ 服务器 - - Can not find the target method. - 队列 - - No state - - - Active Connections - 删除 - - 执行中 - 服务器 总连接数 - - Condition - - - Continuations - 等待中 @@ -357,9 +315,6 @@ 重试次数 - - 没有消息 - 已发送消息 diff --git a/src/DotNetCore.CAP/DotNetCore.CAP.csproj b/src/DotNetCore.CAP/DotNetCore.CAP.csproj index 55ae68e..a22def2 100644 --- a/src/DotNetCore.CAP/DotNetCore.CAP.csproj +++ b/src/DotNetCore.CAP/DotNetCore.CAP.csproj @@ -100,10 +100,10 @@ PublishedPage.cshtml - + PublishedPage.cshtml - + LayoutPage.cshtml @@ -138,9 +138,4 @@ Strings.Designer.cs - - - RazorGenerator - - \ No newline at end of file diff --git a/src/DotNetCore.CAP/Infrastructure/ObjectId.cs b/src/DotNetCore.CAP/Infrastructure/ObjectId.cs index 9dacb04..4a51166 100644 --- a/src/DotNetCore.CAP/Infrastructure/ObjectId.cs +++ b/src/DotNetCore.CAP/Infrastructure/ObjectId.cs @@ -6,7 +6,7 @@ using System.Security.Cryptography; using System.Text; using System.Threading; -namespace DotNetCore.CAP +namespace DotNetCore.CAP.Infrastructure { /// /// Represents an ObjectId diff --git a/src/DotNetCore.CAP/Models/CapMessageDto.cs b/src/DotNetCore.CAP/Models/CapMessageDto.cs index fa1edf7..83b448f 100644 --- a/src/DotNetCore.CAP/Models/CapMessageDto.cs +++ b/src/DotNetCore.CAP/Models/CapMessageDto.cs @@ -1,4 +1,5 @@ using System; +using DotNetCore.CAP.Infrastructure; namespace DotNetCore.CAP.Models { diff --git a/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs b/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs index cd4e236..6234c9c 100644 --- a/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs +++ b/src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs @@ -57,7 +57,7 @@ namespace DotNetCore.CAP.NodeDiscovery { CapCache.Global.AddOrUpdate("cap.nodes.count", 0, TimeSpan.FromSeconds(20)); - _logger.LogError("Get consul nodes raised an exception. Exception:" + ex.Message); + _logger.LogError($"Get consul nodes raised an exception. Exception:{ex.Message},{ex.InnerException.Message}"); return null; } } @@ -85,7 +85,7 @@ namespace DotNetCore.CAP.NodeDiscovery } catch (Exception ex) { - _logger.LogError("Register consul nodes raised an exception. Exception:" + ex.Message); + _logger.LogError($"Get consul nodes raised an exception. Exception:{ex.Message},{ex.InnerException.Message}"); return null; } } diff --git a/src/DotNetCore.CAP/Processor/States/IState.Succeeded.cs b/src/DotNetCore.CAP/Processor/States/IState.Succeeded.cs index f590fe2..fdb41e5 100644 --- a/src/DotNetCore.CAP/Processor/States/IState.Succeeded.cs +++ b/src/DotNetCore.CAP/Processor/States/IState.Succeeded.cs @@ -12,9 +12,9 @@ namespace DotNetCore.CAP.Processor.States ExpiresAfter = TimeSpan.FromHours(1); } - public SucceededState(int ExpireAfterSeconds) + public SucceededState(int expireAfterSeconds) { - ExpiresAfter = TimeSpan.FromSeconds(ExpireAfterSeconds); + ExpiresAfter = TimeSpan.FromSeconds(expireAfterSeconds); } public TimeSpan? ExpiresAfter { get; }