go-trader icon indicating copy to clipboard operation
go-trader copied to clipboard

make sure the goroutine wont shut down in a docker

Open napoleon665 opened this issue 1 year ago • 2 comments

napoleon665 avatar Jul 18 '24 01:07 napoleon665

It would be helpful if you are a bit more explicit in the problem statement.

I gather that what is happening is that the Docker container does not have standard input available, so the processing of standard input terminates leading to shutdown.

A few things:

The changes break the current interactive behavior, because if the user types quit, the process will still hang on the outer select and not terminate.

I believe the proper fix is to be more explicit. Move the input processing to its own function, and in the main() check if standard input is available and if so call the function, and if not perform the infinite select.

What do you think?

robaho avatar Jul 18 '24 13:07 robaho

@napoleon665 did you see my previous question?

robaho avatar Jul 22 '24 23:07 robaho