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
b7f7e2e
..
4a7ba84
100644
(file)
--- a/
lib/xdsserver/sdks.go
+++ b/
lib/xdsserver/sdks.go
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2017 "IoT.bzh"
+ * Copyright (C) 2017
-2018
"IoT.bzh"
* Author Sebastien Douheret <sebastien@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author Sebastien Douheret <sebastien@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-24,8
+24,8
@@
import (
"strings"
"sync"
"strings"
"sync"
- common "g
ithub.com/iotbzh/xds-common
/golib"
- "g
ithub.com/iotbzh
/xds-server/lib/xsapiv1"
+ common "g
errit.automotivelinux.org/gerrit/src/xds/xds-common.git
/golib"
+ "g
errit.automotivelinux.org/gerrit/src/xds
/xds-server/lib/xsapiv1"
)
// SDKs List of installed SDK
)
// SDKs List of installed SDK
@@
-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)
@@
-211,7
+218,7
@@
func (s *SDKs) monitorSDKInstallation(watchingDirs []string) {
sdk.Path = sdkDef.SetupFile
// Emit Folder state change event
sdk.Path = sdkDef.SetupFile
// Emit Folder state change event
- if err := s.events.Emit(xsapiv1.EVTSDK
Install
, sdk, ""); err != nil {
+ if err := s.events.Emit(xsapiv1.EVTSDK
Add
, sdk, ""); err != nil {
s.Log.Warningf("Cannot notify SDK install: %v", err)
}
s.Log.Warningf("Cannot notify SDK install: %v", err)
}