예제 #1
0
        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);
        }
예제 #2
0
    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);
    }