Skip to content

Commit

Permalink
hotfix(datasource): 读写锁异常问题 (#132)
Browse files Browse the repository at this point in the history
<!--
Thanks for sending a pull request!
Before submitting your pull request, please make sure the checklist
below is confirmed.
Your pull requests will be merged after one of the collaborators
approve.
-->

### What type of PR is this?

<!--
Add one of the following kinds:
/kind feat
/kind bug
/kind cleanup
/kind doc

Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

### What this PR does?

### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related
issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

#### Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires
additional action from users switching to the new release, include the
string "action required".
-->
```release-note

```
  • Loading branch information
aide-cloud authored Apr 27, 2024
1 parent 68a2acc commit f048eab
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/agent/datasource/p8s/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,14 @@ func (p *PrometheusDatasource) Query(ctx context.Context, expr string, duration

// GetCategory 获取数据源类型
func (p *PrometheusDatasource) GetCategory() agent.Category {
p.mut.RLocker()
defer p.mut.RUnlock()
return p.category
}

func (p *PrometheusDatasource) GetEndpoint() string {
p.mut.RLocker()
defer p.mut.RUnlock()
return p.endpoint
}

func (p *PrometheusDatasource) GetBasicAuth() *agent.BasicAuth {
p.mut.RLocker()
defer p.mut.RUnlock()
return p.basicAuth
}

Expand Down

0 comments on commit f048eab

Please sign in to comment.