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

server: fix REST connection #175

Merged
merged 2 commits into from
Nov 24, 2020
Merged

server: fix REST connection #175

merged 2 commits into from
Nov 24, 2020

Conversation

guggero
Copy link
Member

@guggero guggero commented Nov 23, 2020

Because of a misplaced defer of a context cancel, the REST proxy didn't
work at all before the fix in this commit.

server.go Show resolved Hide resolved
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🐋

@@ -194,8 +195,8 @@ func (s *Server) Start() error {

// We'll also create and start an accompanying proxy to serve
// clients through REST.
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch!

Copy link
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

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

LGTM 🕺

@halseth
Copy link
Contributor

halseth commented Nov 24, 2020

@guggero Linter failing. Can merge once Travis pass.

server.go Outdated Show resolved Hide resolved
If the REST listener is not nil at this point, it is always already
wrapped in a TLS listener and doesn't need to be wrapped again.
Because of a misplaced defer of a context cancel, the REST proxy didn't
work at all before the fix in this commit.
@guggero guggero merged commit c40b8e4 into lightninglabs:master Nov 24, 2020
@guggero guggero deleted the fix-rest branch November 24, 2020 10:40
positiveblue pushed a commit to positiveblue/pool that referenced this pull request Oct 11, 2022
Funding conflicts: Add auctioncli commands and track in Prometheus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants