Skip to content

Commit

Permalink
feat: added logs to verify client caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayushi Sharma committed Mar 6, 2025
1 parent bb1d027 commit fa7a3f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/providers/maxcompute/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ func (p *provider) getOdpsClient(pc *domain.ProviderConfig, overrideRamRole stri

if c, exists := p.odpsClients[cachedClientKey]; exists {
if c.authConfig.IsConfigValid() {
fmt.Println("retreived cached client")
return c.client, nil
}
p.mu.Lock()
Expand All @@ -454,6 +455,7 @@ func (p *provider) getOdpsClient(pc *domain.ProviderConfig, overrideRamRole stri
defer p.mu.Unlock()
p.odpsClients[cachedClientKey] = ODPSClient{client: client, authConfig: authConfig}

fmt.Println("created new client")
return client, nil
}

Expand Down
2 changes: 2 additions & 0 deletions plugins/providers/oss/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ func (p *provider) getOSSClient(pc *domain.ProviderConfig, ramRole string) (*oss
// Check cache for existing client
if cachedClient, exists := p.ossClients[cachedClientKey]; exists {
if cachedClient.authConfig.IsConfigValid() {
fmt.Println("retreived cached client")
return cachedClient.client, nil
}
p.mu.Lock()
Expand All @@ -410,6 +411,7 @@ func (p *provider) getOSSClient(pc *domain.ProviderConfig, ramRole string) (*oss
p.mu.Lock()
defer p.mu.Unlock()
p.ossClients[cachedClientKey] = OSSClient{client: client, authConfig: authConfig}
fmt.Println("created new client")

return client, nil
}
Expand Down

0 comments on commit fa7a3f7

Please sign in to comment.