Skip to content

Refactor profiler config out of main.go#206

Merged
liam-lowe merged 1 commit intomainfrom
liam-lowe/config
Mar 31, 2026
Merged

Refactor profiler config out of main.go#206
liam-lowe merged 1 commit intomainfrom
liam-lowe/config

Conversation

@liam-lowe
Copy link
Copy Markdown
Contributor

What was changed

Moves initialisation of profiler into proxy.Start() to abstract out of main.go.

Why?

main.go is cluttered with unnecessary setup logic which should be abstracted.

}

func (s *Proxy) Start() error {
s.startPProfHTTPServer()
Copy link
Copy Markdown
Contributor Author

@liam-lowe liam-lowe Mar 31, 2026

Choose a reason for hiding this comment

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

I moved to top of proxy.Start() to mirror previous placement (before proxy.Start()).

There's an argument for having it in various other places (ie profiler first, health check first, etc. ) but I think this is suitable - and it mirrors previous implementation which had no concerns.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems reasonable to me 👍

@liam-lowe liam-lowe marked this pull request as ready for review March 31, 2026 18:54
@liam-lowe liam-lowe requested a review from a team as a code owner March 31, 2026 18:54
Copy link
Copy Markdown

@pseudomuto pseudomuto left a comment

Choose a reason for hiding this comment

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

Nothing but nits! :shipit:

}

func (s *Proxy) Start() error {
s.startPProfHTTPServer()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems reasonable to me 👍

.gitignore Outdated
.claude/

# Vim swap files
*.swp
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

/nit no biggie, I'm also a vim user, but I have to imagine most people have swap files disabled or have this in their own global gitignore.

If you think it's worth having here, I have no objections, but maybe we borrow from here to include all kinds of vim temp things?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair call!

Comment on lines 90 to 94
// Waits until interrupt signal from OS arrives
select {
case <-proxyParams.Proxy.Done():
case <-interruptCh():
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this can be moved to proxy.Start() as well?

@liam-lowe liam-lowe merged commit 6815a9e into main Mar 31, 2026
5 checks passed
@liam-lowe liam-lowe deleted the liam-lowe/config branch March 31, 2026 21:20
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.

3 participants