Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Move scope helper functions out of main #1833

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

Baarsgaard
Copy link
Contributor

@Baarsgaard Baarsgaard commented Jan 21, 2025

Quick PR for unblocking other PRs running into main function complexity lints (#1818 and #1833)
I reduced the calls to ctrl.GetConfigOrDie() to one as none of it was cached and the exact same config was read and parsed multiple times.

@github-actions github-actions bot added the refactor this PR refactors code without introducing functionality label Jan 21, 2025
@Baarsgaard Baarsgaard marked this pull request as ready for review January 21, 2025 19:11
refactor: only call GetConfigOrDie once
Copy link
Member

@theSuess theSuess left a comment

Choose a reason for hiding this comment

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

LGTM, just one question before merging: is there a difference between config.GetConfigOrDie and ctrl.GetConfigOrDie?

@theSuess theSuess added this pull request to the merge queue Jan 27, 2025
Merged via the queue into grafana:master with commit f43ae9b Jan 27, 2025
15 checks passed
@Baarsgaard Baarsgaard deleted the refactor_main_function branch January 27, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor this PR refactors code without introducing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants