Browse Source

cleanup code.

master
Savorboard 7 years ago
parent
commit
2b90afd9e8
9 changed files with 12 additions and 59 deletions
  1. +1
    -1
      src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj
  2. +1
    -1
      src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs
  3. +2
    -0
      src/DotNetCore.CAP/CapCache.cs
  4. +0
    -45
      src/DotNetCore.CAP/Dashboard/Content/resx/Strings.zh.resx
  5. +2
    -7
      src/DotNetCore.CAP/DotNetCore.CAP.csproj
  6. +1
    -1
      src/DotNetCore.CAP/Infrastructure/ObjectId.cs
  7. +1
    -0
      src/DotNetCore.CAP/Models/CapMessageDto.cs
  8. +2
    -2
      src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs
  9. +2
    -2
      src/DotNetCore.CAP/Processor/States/IState.Succeeded.cs

+ 1
- 1
src/DotNetCore.CAP.MySql/DotNetCore.CAP.MySql.csproj View File

@@ -12,7 +12,7 @@
<PackageReference Include="Dapper" Version="1.50.2" /> <PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.0.0" />
<PackageReference Include="MySqlConnector" Version="0.26.5" />
<PackageReference Include="MySqlConnector" Version="0.27.0" />
</ItemGroup> </ItemGroup>


<ItemGroup> <ItemGroup>


+ 1
- 1
src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs View File

@@ -43,7 +43,7 @@ namespace DotNetCore.CAP.Abstractions.ModelBinding
{ {
if (IsSuccess) if (IsSuccess)
return $"Success '{Model}'"; return $"Success '{Model}'";
return $"Failed";
return "Failed";
} }


public override bool Equals(object obj) public override bool Equals(object obj)


+ 2
- 0
src/DotNetCore.CAP/CapCache.cs View File

@@ -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 /// Cache is thread safe and will delete expired entries on its own using System.Threading.Timers (which run on
/// <see cref="ThreadPool" /> threads). /// <see cref="ThreadPool" /> threads).
/// </summary> /// </summary>
// ReSharper disable once InheritdocConsiderUsage
// ReSharper disable once InconsistentNaming
public class Cache<K, T> : IDisposable public class Cache<K, T> : IDisposable
{ {
#region Constructor and class members #region Constructor and class members


+ 0
- 45
src/DotNetCore.CAP/Dashboard/Content/resx/Strings.zh.resx View File

@@ -150,9 +150,6 @@
<data name="Common_MoreDetails" xml:space="preserve"> <data name="Common_MoreDetails" xml:space="preserve">
<value>更多...</value> <value>更多...</value>
</data> </data>
<data name="Common_NotAvailable" xml:space="preserve">
<value>N/A</value>
</data>
<data name="Common_PeriodDay" xml:space="preserve"> <data name="Common_PeriodDay" xml:space="preserve">
<value>天</value> <value>天</value>
</data> </data>
@@ -213,27 +210,6 @@
<data name="PerPageSelector_ItemsPerPage" xml:space="preserve"> <data name="PerPageSelector_ItemsPerPage" xml:space="preserve">
<value>每页条数</value> <value>每页条数</value>
</data> </data>
<data name="QueuesPage_NoJobs" xml:space="preserve">
<value>没有作业</value>
</data>
<data name="QueuesPage_NoQueues" xml:space="preserve">
<value>队列中不存在。尝试添加作业到队列</value>
</data>
<data name="QueuesPage_Table_Length" xml:space="preserve">
<value>长度</value>
</data>
<data name="QueuesPage_Table_NextsJobs" xml:space="preserve">
<value>下一个作业</value>
</data>
<data name="QueuesPage_Table_Queue" xml:space="preserve">
<value>队列</value>
</data>
<data name="QueuesPage_Title" xml:space="preserve">
<value>队列</value>
</data>
<data name="ServersPage_NoServers" xml:space="preserve">
<value>没有活动服务器。后台作业将不会被执行。</value>
</data>
<data name="ServersPage_Table_Heartbeat" xml:space="preserve"> <data name="ServersPage_Table_Heartbeat" xml:space="preserve">
<value>心跳</value> <value>心跳</value>
</data> </data>
@@ -276,36 +252,18 @@
<data name="NavigationMenu_Servers" xml:space="preserve"> <data name="NavigationMenu_Servers" xml:space="preserve">
<value>服务器</value> <value>服务器</value>
</data> </data>
<data name="Common_CannotFindTargetMethod" xml:space="preserve">
<value>Can not find the target method.</value>
</data>
<data name="Common_Enqueued" xml:space="preserve"> <data name="Common_Enqueued" xml:space="preserve">
<value>队列</value> <value>队列</value>
</data> </data>
<data name="Common_NoState" xml:space="preserve">
<value>No state</value>
</data>
<data name="Metrics_ActiveConnections" xml:space="preserve">
<value>Active Connections</value>
</data>
<data name="Metrics_DeletedJobs" xml:space="preserve"> <data name="Metrics_DeletedJobs" xml:space="preserve">
<value>删除</value> <value>删除</value>
</data> </data>
<data name="Metrics_ProcessingJobs" xml:space="preserve">
<value>执行中</value>
</data>
<data name="Metrics_Servers" xml:space="preserve"> <data name="Metrics_Servers" xml:space="preserve">
<value>服务器</value> <value>服务器</value>
</data> </data>
<data name="Metrics_TotalConnections" xml:space="preserve"> <data name="Metrics_TotalConnections" xml:space="preserve">
<value>总连接数</value> <value>总连接数</value>
</data> </data>
<data name="Common_Condition" xml:space="preserve">
<value>Condition</value>
</data>
<data name="Common_Continuations" xml:space="preserve">
<value>Continuations</value>
</data>
<data name="Metrics_AwaitingCount" xml:space="preserve"> <data name="Metrics_AwaitingCount" xml:space="preserve">
<value>等待中</value> <value>等待中</value>
</data> </data>
@@ -357,9 +315,6 @@
<data name="MessagesPage_Table_Retries" xml:space="preserve"> <data name="MessagesPage_Table_Retries" xml:space="preserve">
<value>重试次数</value> <value>重试次数</value>
</data> </data>
<data name="MesssagesPage_NoMessages" xml:space="preserve">
<value>没有消息</value>
</data>
<data name="PublishedPage_Title" xml:space="preserve"> <data name="PublishedPage_Title" xml:space="preserve">
<value>已发送消息</value> <value>已发送消息</value>
</data> </data>


+ 2
- 7
src/DotNetCore.CAP/DotNetCore.CAP.csproj View File

@@ -100,10 +100,10 @@
<Compile Update="Dashboard\Pages\PublishedPage.cs"> <Compile Update="Dashboard\Pages\PublishedPage.cs">
<DependentUpon>PublishedPage.cshtml</DependentUpon> <DependentUpon>PublishedPage.cshtml</DependentUpon>
</Compile> </Compile>
<Compile Update="Dashboard\Pages\PublishedPage1.generated.cs">
<Compile Update="Dashboard\Pages\PublishedPage*.cs">
<DependentUpon>PublishedPage.cshtml</DependentUpon> <DependentUpon>PublishedPage.cshtml</DependentUpon>
</Compile> </Compile>
<Compile Update="Dashboard\Pages\LayoutPage1.generated.cs">
<Compile Update="Dashboard\Pages\LayoutPage.*.cs">
<DependentUpon>LayoutPage.cshtml</DependentUpon> <DependentUpon>LayoutPage.cshtml</DependentUpon>
</Compile> </Compile>
<Compile Update="Dashboard\Pages\LayoutPage.cs"> <Compile Update="Dashboard\Pages\LayoutPage.cs">
@@ -138,9 +138,4 @@
<LastGenOutput>Strings.Designer.cs</LastGenOutput> <LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Dashboard\Pages\HomePage.cshtml">
<Generator>RazorGenerator</Generator>
</None>
</ItemGroup>
</Project> </Project>

+ 1
- 1
src/DotNetCore.CAP/Infrastructure/ObjectId.cs View File

@@ -6,7 +6,7 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;


namespace DotNetCore.CAP
namespace DotNetCore.CAP.Infrastructure
{ {
/// <summary> /// <summary>
/// Represents an ObjectId /// Represents an ObjectId


+ 1
- 0
src/DotNetCore.CAP/Models/CapMessageDto.cs View File

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


namespace DotNetCore.CAP.Models namespace DotNetCore.CAP.Models
{ {


+ 2
- 2
src/DotNetCore.CAP/NodeDiscovery/INodeDiscoveryProvider.Consul.cs View File

@@ -57,7 +57,7 @@ namespace DotNetCore.CAP.NodeDiscovery
{ {
CapCache.Global.AddOrUpdate("cap.nodes.count", 0, TimeSpan.FromSeconds(20)); 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; return null;
} }
} }
@@ -85,7 +85,7 @@ namespace DotNetCore.CAP.NodeDiscovery
} }
catch (Exception ex) 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; return null;
} }
} }


+ 2
- 2
src/DotNetCore.CAP/Processor/States/IState.Succeeded.cs View File

@@ -12,9 +12,9 @@ namespace DotNetCore.CAP.Processor.States
ExpiresAfter = TimeSpan.FromHours(1); ExpiresAfter = TimeSpan.FromHours(1);
} }


public SucceededState(int ExpireAfterSeconds)
public SucceededState(int expireAfterSeconds)
{ {
ExpiresAfter = TimeSpan.FromSeconds(ExpireAfterSeconds);
ExpiresAfter = TimeSpan.FromSeconds(expireAfterSeconds);
} }


public TimeSpan? ExpiresAfter { get; } public TimeSpan? ExpiresAfter { get; }


Loading…
Cancel
Save