Skip to content

Commit

Permalink
Merge pull request #67 from actiontech/auth_cloudbeaver
Browse files Browse the repository at this point in the history
auth cloudbeaver
  • Loading branch information
rocky114 authored Oct 23, 2023
2 parents aa5c2fe + 9cd1b22 commit 5a0f04c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/dms/biz/cloudbeaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func (cu *CloudbeaverUsecase) connectManagement(ctx context.Context, cloudbeaver
return err
}

activeDBServices, err = ResetDbServiceByAuth(ctx, activeDBServices)
activeDBServices, err = cu.ResetDbServiceByAuth(ctx, activeDBServices)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/dms/biz/cloudbeaver_ce.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ package biz

import "context"

func ResetDbServiceByAuth(ctx context.Context, activeDBServices []*DBService) ([]*DBService, error) {
func (cu *CloudbeaverUsecase) ResetDbServiceByAuth(ctx context.Context, activeDBServices []*DBService) ([]*DBService, error) {
return activeDBServices, nil
}
7 changes: 3 additions & 4 deletions internal/dms/storage/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ func (d *ProxyTargetRepo) GetProxyTargetByName(ctx context.Context, name string)

var target model.ProxyTarget
if err := transaction(d.log, ctx, d.db, func(tx *gorm.DB) error {

// find targets
if err := tx.WithContext(ctx).Where(&model.ProxyTarget{Name: name}).Find(&target).Error; err != nil {
return fmt.Errorf("failed to list proxy target: %v", err)
// get targets
if err := tx.First(&target, "name = ?", name).Error; err != nil {
return fmt.Errorf("failed to get proxy target: %v", err)
}

return nil
Expand Down

0 comments on commit 5a0f04c

Please sign in to comment.