Skip to content

Commit

Permalink
fix 'no sdk found'
Browse files Browse the repository at this point in the history
  • Loading branch information
moqsien committed Jun 2, 2024
1 parent 6d9a8c5 commit 5fa42fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/download/sdk_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func GetSDKList() (ss SDKList) {
lastModifiedTime := utils.GetFileLastModifiedTime(fPath)
timelag := time.Now().Unix() - lastModifiedTime

if timelag > 1800 {
content, _ := os.ReadFile(fPath)
if timelag > 1800 || len(content) < 20 {
// over half an hour, then download again.
fetcher := cnf.GetFetcher(dUrl)
fetcher.Timeout = 10 * time.Second
Expand All @@ -44,7 +45,6 @@ func GetSDKList() (ss SDKList) {
json.Unmarshal([]byte(resp), &ss)
} else {
// otherwise, read from the cached file.
content, _ := os.ReadFile(fPath)
json.Unmarshal(content, &ss)
}
return
Expand Down

0 comments on commit 5fa42fc

Please sign in to comment.