auto commit
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Yitter.OrgSystem.TestA
|
||||
|
||||
|
||||
static bool single = true;
|
||||
static bool outputLog = true;
|
||||
static bool outputLog = false;
|
||||
static IIdGenerator IdGen = null;
|
||||
static IList<GenTest> testList = new List<GenTest>();
|
||||
static bool checkResult = false;
|
||||
@@ -38,7 +38,7 @@ namespace Yitter.OrgSystem.TestA
|
||||
|
||||
// MaxSeqNumber = 200,
|
||||
|
||||
BaseTime = DateTime.Now.AddYears(-10),
|
||||
// BaseTime = DateTime.Now.AddYears(-10),
|
||||
};
|
||||
|
||||
IIdGenerator IdGen = new DefaultIdGenerator(options);
|
||||
@@ -54,7 +54,7 @@ namespace Yitter.OrgSystem.TestA
|
||||
{
|
||||
Go(options);
|
||||
Thread.Sleep(1000); // 每隔3秒执行一次Go
|
||||
Console.WriteLine("Hello World!");
|
||||
Console.WriteLine("Hello World! C#");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,8 @@ namespace Yitter.IdGenerator
|
||||
|
||||
private void BeginOverCostAction(in long useTimeTick)
|
||||
{
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
return;
|
||||
@@ -137,6 +139,7 @@ namespace Yitter.IdGenerator
|
||||
{
|
||||
_TermIndex = 0;
|
||||
}
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
@@ -154,6 +157,8 @@ namespace Yitter.IdGenerator
|
||||
|
||||
private void BeginTurnBackAction(in long useTimeTick)
|
||||
{
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
return;
|
||||
@@ -170,6 +175,8 @@ namespace Yitter.IdGenerator
|
||||
|
||||
private void EndTurnBackAction(in long useTimeTick)
|
||||
{
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -45,10 +45,15 @@ namespace Yitter.IdGenerator
|
||||
throw new ApplicationException("error:WorkerIdBitLength + SeqBitLength <= 22");
|
||||
}
|
||||
|
||||
if (options.WorkerIdBitLength <= 0)
|
||||
{
|
||||
throw new ApplicationException("WorkerIdBitLength error.(range:[1, 21])");
|
||||
}
|
||||
|
||||
var maxWorkerIdNumber = Math.Pow(2, options.WorkerIdBitLength) - 1;
|
||||
if (options.WorkerId < 0 || options.WorkerId > maxWorkerIdNumber)
|
||||
{
|
||||
throw new ApplicationException("WorkerId error. (range:[1, " + maxWorkerIdNumber + "]");
|
||||
throw new ApplicationException("WorkerId error. (range:[0, " + (maxWorkerIdNumber > 0 ? maxWorkerIdNumber : 63) + "]");
|
||||
}
|
||||
|
||||
if (options.SeqBitLength < 2 || options.SeqBitLength > 21)
|
||||
|
||||
Reference in New Issue
Block a user