Skip to content

Conversation

tommysitu
Copy link
Member

No description provided.

Comment on lines +43 to +48
func (t *TemplateDataSource) GetDataSource(name string) (*DataSource, bool) {
t.rwMutex.RLock()
defer t.rwMutex.RUnlock()

for _, dataSource := range templateDataSource.DataSources {
if dataSource.Name == name {
return true
}
}
return false
source, exits := t.dataSources[name]
return source, exits
Copy link
Member Author

@tommysitu tommysitu Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure safe concurrent access using read lock

@tommysitu tommysitu merged commit 1245f30 into master Aug 28, 2024
4 checks passed
@tommysitu tommysitu deleted the minor-datasource-cleanup branch August 28, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant