mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-03 12:36:54 +00:00
New functions
This commit is contained in:
@@ -2,6 +2,7 @@ package file
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/rate"
|
||||
"math"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
@@ -60,6 +61,9 @@ func NewClient(vKey string, noStore bool, noDisplay bool) *Client {
|
||||
func (s *Client) GetId() int {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
if s.id == math.MaxInt32 {
|
||||
s.id = 0
|
||||
}
|
||||
s.id++
|
||||
return s.id
|
||||
}
|
||||
|
Reference in New Issue
Block a user