[fix] RegisterAsync注册服务不要等待返回,避免阻塞,也避免网络异常发布失败导致服务无法启动

This commit is contained in:
大石头 2025-04-26 21:58:17 +08:00
parent f0df780bb6
commit cfd85f2a63
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ public class Worker : IHostedService
_clearItemTimer = new TimerX(ClearItems, null, 10_000, 3600_000) { Async = true };
// 启用星尘注册中心,向注册中心注册服务,服务消费者将自动更新服务端地址列表
if (_registry != null) await _registry.RegisterAsync("AntServer", $"tcp://*:{server.Port}");
_registry?.RegisterAsync("AntServer", $"tcp://*:{server.Port}");
}
public Task StopAsync(CancellationToken cancellationToken)