Skip to content

Commit 30f003e

Browse files
Merge pull request #3125 from actiontech/cherry-pick_main
Cherry pick main
2 parents 30f1a6e + 6bfda89 commit 30f003e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sqle/api/controller/v1/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ func getGitAuthMethod(url, username, password string) (transport.AuthMethod, err
419419
if err != nil {
420420
return nil, err
421421
}
422-
if systemVariable.Code != 0 {
422+
if systemVariable.Data.SystemVariableSSHPrimaryKey != "" {
423423
return nil, errors.New(errors.DataNotExist, fmt.Errorf("git ssh private key not found"))
424424
}
425425
publicKeys, err := sshTransport.NewPublicKeys("git", []byte(systemVariable.Data.SystemVariableSSHPrimaryKey), "")
@@ -550,7 +550,7 @@ func GetSSHPublicKey(c echo.Context) error {
550550
if err != nil {
551551
return controller.JSONBaseErrorReq(c, err)
552552
}
553-
if systemVariable.Code != 0 {
553+
if systemVariable.Data.SystemVariableSSHPrimaryKey == "" {
554554
return c.JSON(http.StatusOK, SSHPublicKeyInfoV1Rsp{
555555
BaseRes: controller.NewBaseReq(nil),
556556
Data: SSHPublicKeyInfo{

sqle/server/clean.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func getOperationRecordExpiredHours(entry *logrus.Entry) (operationRecordExpired
157157

158158
operationRecordExpiredHours = dms.DefaultOperationRecordExpiredHours
159159
systemVariables, err := dmsobject.GetSystemVariables(context.TODO(), dms.GetDMSServerAddress())
160-
if err != nil || systemVariables.Code != 0 {
160+
if err != nil {
161161
entry.Warnf("get system variables failed, err: %s", err.Error())
162162
return operationRecordExpiredHours
163163
}

0 commit comments

Comments
 (0)