mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 08:04:17 +02:00
fix doc add id creation, use rand.Int64()
This commit is contained in:
@@ -21,8 +21,8 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand/v2"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"codeberg.org/scip/esctl/pkg/cfg"
|
||||
"github.com/elastic/go-elasticsearch/v9/typedapi/core/deletebyquery"
|
||||
@@ -45,7 +45,7 @@ func DocAdd(conf *cfg.Config, jsondoc string) error {
|
||||
return fmt.Errorf("supplied document was not valid JSON: %s", err)
|
||||
}
|
||||
|
||||
now := fmt.Sprintf("%d", time.Now().Unix())
|
||||
now := fmt.Sprintf("%d", rand.Int64())
|
||||
|
||||
res, err := conf.DefaultCluster.ES.Create(conf.Index, now).
|
||||
Document(data).
|
||||
|
||||
Reference in New Issue
Block a user