提交 2f7a9fa2 编写于 作者: Z zhouzj

TermIndex复位

上级 1d284e6d
......@@ -75,7 +75,6 @@ namespace Yitter.IdGenerator
StartTimeUtc = options.StartTime;
}
// 如果没有初始化,则随机一个数值
if (WorkerId < 1)
{
WorkerId = (ushort)DateTime.Now.Millisecond;
......@@ -104,11 +103,6 @@ namespace Yitter.IdGenerator
{
Task.Run(() =>
{
if (arg.ActionType == 2 && _TermIndex > 10000)
{
_TermIndex = 0;
}
GenAction(arg);
});
}
......@@ -131,6 +125,11 @@ namespace Yitter.IdGenerator
private void EndOverCostCallBack(in long useTimeTick)
{
if (_TermIndex > 10000)
{
_TermIndex = 0;
}
if (GenAction == null)
{
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册