0

Problem Statement:

Whenever Customer closes browser or client closes connection , golang mux HTTP handler cancels the requests with context cancelled error.

Expectation: On certain routes if customer closes browser or drops off, we want to process requests and do not want to cancel the request.

Arjun Tomer
  • 19
  • 1
  • 3
  • 3
    You cannot stop the request context from being cancelled, but nothing forces you to use it. Just use context.Background() instead. If you want to preserve values stored in the context, see https://stackoverflow.com/questions/54128834/context-without-cancel-propagation. – Peter Oct 03 '22 at 10:00

0 Answers0