remove mathutil.Max

This commit is contained in:
LiHui
2021-09-29 09:35:18 +08:00
parent ad69b08a75
commit 09fc2867c4
3 changed files with 6 additions and 17 deletions

View File

@@ -17,13 +17,12 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"math"
"net/url"
"strconv"
"strings"
"time"
"kubesphere.io/kubesphere/pkg/utils/mathutil"
restful "github.com/emicklei/go-restful"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -101,7 +100,7 @@ func (h *openpitrixHandler) CreateRepo(req *restful.Request, resp *restful.Respo
api.HandleBadRequest(resp, nil, err)
return
} else if duration > 0 {
syncPeriod = mathutil.Max(int(duration/time.Second), constants.HelmRepoMinSyncPeriod)
syncPeriod = int(math.Max(float64(duration/time.Second), constants.HelmRepoMinSyncPeriod))
}
}