Skip to content

Commit

Permalink
Switch from UnixNano to UnixMilli for did
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Dec 22, 2023
1 parent 39594ec commit 2eca081
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ func insertData(sname string, rec Record) error {
log.Printf("input data, record %v, path %v\n", rec, path)
rec["path"] = path
// we generate unique id by using time stamp
did := time.Now().UnixNano()
// use UnixMilli as UnixNano is truncated in MongoDB
did := time.Now().UnixMilli()
err = InsertFiles(did, dataset, path)
if err != nil {
log.Printf("ERROR: unable to InsertFiles for did=%v dataset=%s path=%s, error=%v", did, dataset, path, err)
Expand Down

0 comments on commit 2eca081

Please sign in to comment.