Use nanoseconds for campaign IDs (#6216)

Fixes #4806 by adding resolution to the generated IDs.
This commit is contained in:
Aaron 2022-06-14 17:46:09 +02:00 committed by GitHub
parent 8fe63d1260
commit 75f093e802
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,7 @@ func (svc *Service) NewDistributedQueryCampaign(ctx context.Context, queryString
return nil, err
}
query = &fleet.Query{
Name: fmt.Sprintf("distributed_%s_%d", vc.Email(), time.Now().Unix()),
Name: fmt.Sprintf("distributed_%s_%d", vc.Email(), time.Now().UnixNano()),
Query: queryString,
Saved: false,
AuthorID: ptr.Uint(vc.UserID()),