public async override Task StartAsync(CancellationToken cancellationToken) { await _workerNode.InitWorkerNodesAsync(_serviceName); var workerId = await _workerNode.GetWorkerIdAsync(_serviceName); YitterSnowFlake.CurrentWorkerId = (short)workerId; await base.StartAsync(cancellationToken); }
public override async Task StartAsync(CancellationToken cancellationToken) { await _workerNode.InitWorkerNodesAsync(_serviceName); var workerId = await _workerNode.GetWorkerIdAsync(_serviceName); IdGenerater.SetWorkerId((ushort)workerId); await base.StartAsync(cancellationToken); }