[VOL-2735]Durations in voltha-lib-go should be specified as type time.Duration not int
Change-Id: I782e44fe1dc041b9eb54fd837950d2176e18fe42
diff --git a/pkg/techprofile/config.go b/pkg/techprofile/config.go
index 4af2bd5..8a304be 100644
--- a/pkg/techprofile/config.go
+++ b/pkg/techprofile/config.go
@@ -17,6 +17,7 @@
import (
"github.com/opencord/voltha-lib-go/v3/pkg/db"
+ "time"
)
// tech profile default constants
@@ -28,7 +29,7 @@
defaultGemportsCount = 1
defaultPbits = "0b11111111"
- defaultKVStoreTimeout = 5 //in seconds
+ defaultKVStoreTimeout = 5 * time.Second //in seconds
// Tech profile path prefix in kv store
defaultKVPathPrefix = "service/voltha/technology_profiles"
@@ -78,7 +79,7 @@
KVStoreHost string
KVStorePort int
KVStoreType string
- KVStoreTimeout int
+ KVStoreTimeout time.Duration
KVBackend *db.Backend
TPKVPathPrefix string
TPFileKVPath string
diff --git a/pkg/techprofile/tech_profile.go b/pkg/techprofile/tech_profile.go
index 316bd57..cbbe835 100644
--- a/pkg/techprofile/tech_profile.go
+++ b/pkg/techprofile/tech_profile.go
@@ -23,6 +23,7 @@
"fmt"
"regexp"
"strconv"
+ "time"
"github.com/opencord/voltha-lib-go/v3/pkg/db"
@@ -268,7 +269,7 @@
*/
}
-func newKVClient(storeType string, address string, timeout int) (kvstore.Client, error) {
+func newKVClient(storeType string, address string, timeout time.Duration) (kvstore.Client, error) {
logger.Infow("kv-store", log.Fields{"storeType": storeType, "address": address})
switch storeType {