mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SQLStore: Fix race condition in RecursiveQueriesAreSupported (#75274)
This commit is contained in:
parent
c78d5fa4e3
commit
15f6e8a500
@ -55,6 +55,7 @@ type SQLStore struct {
|
||||
migrations registry.DatabaseMigrator
|
||||
tracer tracing.Tracer
|
||||
recursiveQueriesAreSupported *bool
|
||||
recursiveQueriesMu sync.Mutex
|
||||
}
|
||||
|
||||
func ProvideService(cfg *setting.Cfg, cacheService *localcache.CacheService, migrations registry.DatabaseMigrator, bus bus.Bus, tracer tracing.Tracer) (*SQLStore, error) {
|
||||
@ -524,6 +525,8 @@ func (ss *SQLStore) GetMigrationLockAttemptTimeout() int {
|
||||
}
|
||||
|
||||
func (ss *SQLStore) RecursiveQueriesAreSupported() (bool, error) {
|
||||
ss.recursiveQueriesMu.Lock()
|
||||
defer ss.recursiveQueriesMu.Unlock()
|
||||
if ss.recursiveQueriesAreSupported != nil {
|
||||
return *ss.recursiveQueriesAreSupported, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user