From 2eca081cf252fb395830fa14576deb7f8bce92ab Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Fri, 22 Dec 2023 07:26:36 -0500 Subject: [PATCH] Switch from UnixNano to UnixMilli for did --- web/helpers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/helpers.go b/web/helpers.go index 340715e..2920350 100644 --- a/web/helpers.go +++ b/web/helpers.go @@ -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)