From ed0e372a6e90f98c8a4d917f79b5c414aac68b1d Mon Sep 17 00:00:00 2001 From: Victor Vrantchan Date: Sun, 30 Jun 2019 00:27:45 -0400 Subject: [PATCH] set ack time only if command is not nil --- platform/queue/queue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/queue/queue.go b/platform/queue/queue.go index d83f9904..8d5e0b4b 100644 --- a/platform/queue/queue.go +++ b/platform/queue/queue.go @@ -83,11 +83,11 @@ func (db *Store) nextCommand(ctx context.Context, resp mdm.Response) (*Command, case "Acknowledged": // move to completed, send next x, a := cut(dc.Commands, resp.CommandUUID) - x.Acknowledged = time.Now().UTC() dc.Commands = a if x == nil { break } + x.Acknowledged = time.Now().UTC() dc.Completed = append(dc.Completed, *x) case "Error": // move to failed, send next