3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

Merge pull request #975 from slingamn/shorten_batch_id

use shorter batch IDs
This commit is contained in:
Shivaram Lingamneni 2020-05-05 03:27:43 -07:00 committed by GitHub
commit 872fd3e77c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,7 +231,7 @@ func (session *Session) HasHistoryCaps() bool {
// this allows ~4 billion such batches which should be fine. // this allows ~4 billion such batches which should be fine.
func (session *Session) generateBatchID() string { func (session *Session) generateBatchID() string {
id := atomic.AddUint32(&session.batchCounter, 1) id := atomic.AddUint32(&session.batchCounter, 1)
return strconv.Itoa(int(id)) return strconv.FormatInt(int64(id), 32)
} }
// WhoWas is the subset of client details needed to answer a WHOWAS query // WhoWas is the subset of client details needed to answer a WHOWAS query