Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Added target and terminal support.
[src/xds/xds-server.git]
/
lib
/
xdsserver
/
sdks.go
diff --git
a/lib/xdsserver/sdks.go
b/lib/xdsserver/sdks.go
index
c006861
..
4a7ba84
100644
(file)
--- a/
lib/xdsserver/sdks.go
+++ b/
lib/xdsserver/sdks.go
@@
-38,8
+38,8
@@
type SDKs struct {
stop chan struct{} // signals intentional stop
}
stop chan struct{} // signals intentional stop
}
-//
NewSDKs
creates a new instance of SDKs
-func
NewSDKs
(ctx *Context) (*SDKs, error) {
+//
SDKsConstructor
creates a new instance of SDKs
+func
SDKsConstructor
(ctx *Context) (*SDKs, error) {
s := SDKs{
Context: ctx,
Sdks: make(map[string]*CrossSDK),
s := SDKs{
Context: ctx,
Sdks: make(map[string]*CrossSDK),
@@
-63,6
+63,12
@@
func NewSDKs(ctx *Context) (*SDKs, error) {
return &s, err
}
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()
s.mutex.Lock()
defer s.mutex.Unlock()
@@
-73,10
+79,11
@@
func NewSDKs(ctx *Context) (*SDKs, error) {
continue
}
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)
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)
}
s.LogSillyf("'%s' SDKs list: %v", d, sdksList)