summaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/sdks.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-02-06 17:07:30 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-02-06 17:11:30 +0100
commit0a53346ecd92e1281587c724631fdf76dc756fc7 (patch)
treedd9996613a7f4237fd996be9a54949369cd064f4 /lib/xdsserver/sdks.go
parent60a59bcfdb3c2404a468cc314b7afde85ee35e1b (diff)
Auto update SDK DB on startup.
Auto update db is enable by default (setting sdkDbUpdate = "startup") but it can be disable by setting sdkDbUpdate to "disable" in server config file. Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsserver/sdks.go')
-rw-r--r--lib/xdsserver/sdks.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/xdsserver/sdks.go b/lib/xdsserver/sdks.go
index c006861..6094045 100644
--- a/lib/xdsserver/sdks.go
+++ b/lib/xdsserver/sdks.go
@@ -63,6 +63,12 @@ func NewSDKs(ctx *Context) (*SDKs, error) {
return &s, err
}
+ // Update SDK DB on startup by default (can be disable using config file)
+ update := true
+ if s.Config.FileConf.SdkDbUpdate != "startup" {
+ update = false
+ }
+
s.mutex.Lock()
defer s.mutex.Unlock()
@@ -73,10 +79,11 @@ func NewSDKs(ctx *Context) (*SDKs, error) {
continue
}
- sdksList, err := ListCrossSDK(d, s.Log)
+ sdksList, err := ListCrossSDK(d, update, s.Log)
if err != nil {
// allow to use XDS even if error on list
s.Log.Errorf("Cannot retrieve SDK list: %v", err)
+ sdksList, _ = ListCrossSDK(d, false, s.Log)
}
s.LogSillyf("'%s' SDKs list: %v", d, sdksList)