From 6f9963e980ad3e761710c86b84cb6803c93bd24d Mon Sep 17 00:00:00 2001 From: pierre818181 Date: Mon, 13 Jan 2025 15:14:48 -0600 Subject: [PATCH] fix: time in milliseconds --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index b29f4f6..5b8b4ea 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,7 @@ type Result struct { ExpectedError string `json:"expectedError"` ActualError string `json:"actualError"` - ExecutionTime int `json:"executionTime"` + ExecutionTime int64 `json:"executionTime"` } type Handler struct { @@ -257,7 +257,7 @@ func cancelJob(timeout int, jobIndex int) { ActualOutput: nil, ExpectedError: "", ActualError: "Execution timeout exceeded", - ExecutionTime: int(time.Since(testConfig[jobIndex].StartedAt).Milliseconds()), + ExecutionTime: time.Since(testConfig[jobIndex].StartedAt).Milliseconds(), Mode: *testConfig[jobIndex].Mode, }) @@ -316,7 +316,7 @@ func (h *Handler) JobDone(c *gin.Context) { Name: lastTest.Name, ExpectedOutput: lastTest.ExpectedOutput.Payload, ActualOutput: actualOutput, - ExecutionTime: int(time.Since(lastTest.StartedAt).Seconds()), + ExecutionTime: time.Since(lastTest.StartedAt).Milliseconds(), Status: "FAILED", Mode: *lastTest.Mode, }) @@ -334,7 +334,7 @@ func (h *Handler) JobDone(c *gin.Context) { Name: lastTest.Name, ExpectedOutput: lastTest.ExpectedOutput.Payload, ActualOutput: actualOutput, - ExecutionTime: int(time.Since(lastTest.StartedAt).Seconds()), + ExecutionTime: time.Since(lastTest.StartedAt).Milliseconds(), Status: "SUCCESS", Mode: *lastTest.Mode, })