Skip to content

Commit

Permalink
Merge pull request #14 from yileicn/hotfix
Browse files Browse the repository at this point in the history
优化Consul PollForChanges
  • Loading branch information
yileicn authored Aug 25, 2021
2 parents e5f76f7 + f31de6d commit b87b556
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Grpc.Extension.Client/Options/JaegerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class JaegerOptions
/// <summary>
/// 是否启用Jaeger
/// </summary>
public bool Enable { get; set; } = true;
public bool Enable { get; set; }

/// <summary>
/// 服务名
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public async Task<List<string>> GetEndpoints(string serviceName, string consulUr
//更新LastIndex
UpdateLastIndex(serviceName, res);
//PollForChanges
_ = Task.Run(() => PollForChanges(serviceName, consulUrl, consulTag));
if (!_pollForChanges.Contains(serviceName))
_ = Task.Run(() => PollForChanges(serviceName, consulUrl, consulTag));

return res.Response.Select(q => $"{q.Service.Address}:{q.Service.Port}").ToList();
}
Expand Down

0 comments on commit b87b556

Please sign in to comment.