Browse Source

Refactoring

master
Savorboard 6 years ago
parent
commit
77a0ba3009
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/DotNetCore.CAP/ISubscribeExecutor.Default.cs
  2. +0
    -1
      src/DotNetCore.CAP/Infrastructure/Helper.cs
  3. +2
    -1
      src/DotNetCore.CAP/Infrastructure/SnowflakeId.cs

+ 1
- 1
src/DotNetCore.CAP/ISubscribeExecutor.Default.cs View File

@@ -164,7 +164,7 @@ namespace DotNetCore.CAP
if (!_selector.TryGetTopicExector(receivedMessage.Name, receivedMessage.Group,
out var executor))
{
var error = $"message can not be found subscriber, Message:{receivedMessage},\r\n see: https://github.com/dotnetcore/CAP/issues/63";
var error = $"Message can not be found subscriber. {receivedMessage} \r\n see: https://github.com/dotnetcore/CAP/issues/63";
throw new SubscriberNotFoundException(error);
}



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

@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using DotNetCore.CAP.Diagnostics;
using Newtonsoft.Json;


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

@@ -2,6 +2,7 @@
// An object that generates IDs. This is broken into a separate class in case we ever want to support multiple worker threads per process

using System;
using System.Threading;

namespace DotNetCore.CAP.Infrastructure
{
@@ -49,7 +50,7 @@ namespace DotNetCore.CAP.Infrastructure
{
lock (s_lock)
{
return _snowflakeId ?? (_snowflakeId = new SnowflakeId(AppDomain.CurrentDomain.Id, datacenterId));
return _snowflakeId ?? (_snowflakeId = new SnowflakeId(Thread.CurrentThread.ManagedThreadId, datacenterId));
}
}



Loading…
Cancel
Save