Switch to using float64 for run durations

Signed-off-by: AKU <tom@tdpain.net>
This commit is contained in:
akp 2021-11-27 15:59:55 +00:00
parent 34028fa131
commit a0a651f8f6
No known key found for this signature in database
GPG key ID: AA5726202C8879B7
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ type Result struct {
TaskID string `json:"task_id"`
Ok bool `json:"ok"`
Output string `json:"output"`
Duration float32 `json:"duration"`
Duration float64 `json:"duration"`
}
func makeErrorChan(err error) chan ResultOrError {

View file

@ -12,7 +12,7 @@ import (
chcode "{{ .ImportPath }}"
)
func sendResult(taskID string, ok bool, output string, duration float32) {
func sendResult(taskID string, ok bool, output string, duration float64) {
x := runners.Result{
TaskID: taskID,
Ok: ok,
@ -62,7 +62,7 @@ func run() error {
res, err := run()
endTIme := time.Now()
runningTime := float32(endTIme.Sub(startTime).Seconds())
runningTime := endTIme.Sub(startTime).Seconds()
if err != nil {
sendResult(task.TaskID, false, err.Error(), runningTime)