@@ -15,7 +15,7 @@ import (
15
15
16
16
type Client struct {}
17
17
type updateInfo struct {
18
- DownloadUrl string `json:"download_url"`
18
+ DownloadUrl string `json:"download_url"`
19
19
Description string `json:"description"`
20
20
IsAvailable bool `json:"is_available"`
21
21
IsDisabled bool `json:"is_disabled"`
@@ -51,18 +51,22 @@ func (Client) CheckUpdate(ctx *gin.Context) {
51
51
}
52
52
deploymentVersion := model.DeploymentVersion {}.GetByKeyDeploymentIdAndVersion (* deployment .Id , appVersion )
53
53
if deploymentVersion != nil {
54
- packag := model .GetOne [model.Package ]("id" , deploymentVersion .CurrentPackage )
55
- if packag != nil {
56
- // && *packag.Hash != packageHash
57
- updateInfoRedis .TargetBinaryRange = * deploymentVersion .AppVersion
58
- updateInfoRedis .PackageHash = * packag .Hash
59
- updateInfoRedis .PackageSize = * packag .Size
60
- updateInfoRedis .IsAvailable = true
61
- updateInfoRedis .IsMandatory = true
62
- label := strconv .Itoa (* packag .Id )
63
- updateInfoRedis .Label = label
64
- updateInfoRedis .DownloadUrl = config .ResourceUrl + * packag .Download
65
- updateInfoRedis .Description = * packag .Description
54
+ if deploymentVersion .CurrentPackage != nil {
55
+ packag := model .GetOne [model.Package ]("id" , deploymentVersion .CurrentPackage )
56
+ if packag != nil {
57
+ // && *packag.Hash != packageHash
58
+ updateInfoRedis .TargetBinaryRange = * deploymentVersion .AppVersion
59
+ updateInfoRedis .PackageHash = * packag .Hash
60
+ updateInfoRedis .PackageSize = * packag .Size
61
+ updateInfoRedis .IsAvailable = true
62
+ updateInfoRedis .IsMandatory = true
63
+ label := strconv .Itoa (* packag .Id )
64
+ updateInfoRedis .Label = label
65
+ updateInfoRedis .DownloadUrl = config .ResourceUrl + * packag .Download
66
+ if packag .Description != nil {
67
+ updateInfoRedis .Description = * packag .Description
68
+ }
69
+ }
66
70
}
67
71
}
68
72
deploymentVersionNew := model.DeploymentVersion {}.GetNewVersionByKeyDeploymentId (* deployment .Id )
0 commit comments