File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "io"
77 "os"
88 "strings"
9- "sync"
109 "time"
1110
1211 "github.com/chainreactors/IoM-go/consts"
@@ -110,24 +109,15 @@ type SaasClient struct {
110109 LicenseType string
111110}
112111
113- var (
114- globalSaasClient * SaasClient
115- saasOnce sync.Once
116- )
117-
118112func GetSaasClient () * SaasClient {
119- saasOnce .Do (func () {
120- saasConfig := configs .GetSaasConfig ()
121- if ! saasConfig .Enable {
122- globalSaasClient = & SaasClient {}
123- } else {
124- globalSaasClient = & SaasClient {
125- Token : saasConfig .Token ,
126- BaseURL : saasConfig .Url ,
127- }
128- }
129- })
130- return globalSaasClient
113+ saasConfig := configs .GetSaasConfig ()
114+ if ! saasConfig .Enable {
115+ return & SaasClient {}
116+ }
117+ return & SaasClient {
118+ Token : saasConfig .Token ,
119+ BaseURL : saasConfig .Url ,
120+ }
131121}
132122
133123func (c * SaasClient ) SetLicenseType (typ string ) {
You can’t perform that action at this time.
0 commit comments