diff --git a/uid.go b/uid.go index db7c727..097edcd 100644 --- a/uid.go +++ b/uid.go @@ -43,7 +43,7 @@ type Range struct { Length int // lenght of this range } type rangeQueue struct { - deque.Deque[*Range] + //deque.Deque[*Range] } const ( @@ -78,7 +78,8 @@ func NewIdCreator(typ string, helper IdCreatorHelper) IdCreator { // Step 3. backgroud task for generate range go func() { - for { + for i := 0; ; i++ { + log.SetLogid(fmt.Sprintf("uidcreator%07d", i)) for prefix, queue := range idg.Ranges { var qlen = queue.Len() var timeoutMs = 1 * time.Millisecond @@ -98,7 +99,7 @@ func NewIdCreator(typ string, helper IdCreatorHelper) IdCreator { time.Sleep((-timeoutMs) * time.Millisecond) } } - time.Sleep(1000 * time.Millisecond) + time.Sleep(3000 * time.Millisecond) } }()