Bogay

Results 37 comments of Bogay

as #3358 merged. maybe it's ok to close this?

I am not very sure of the best way to handle this, but perhaps adding a signal handling to call [`server.Shutdown`](https://pkg.go.dev/net/http#Server.Shutdown) is enough? FYI: https://gin-gonic.com/docs/examples/graceful-restart-or-stop/

@discordianfish Do you mean calling `os.Exit(0)` in the signal handler?

Sorry for the very late reply. I got some time these days and fixed it. If it's OK to merge, I'll reorg it into a few commits. > Reminder that...

> Looks good to me now. The added UI tests are nice too! Please do whatever else you meant to do and squash the remaining commits. It should be good...

> Which one of the options do you think is best, or maybe something else? Currently I prefer to warn the user when explicit mappings are given to `StringHint`, but...

> I suppose `StringHint::export_info` isn't the best place to emit a warning from, but it should be acceptable. Not pretty, but acceptable. You _can_ frame it as sanitation during conversion...

According to the source. It seems that `rtoml.load` will pass the arg directly to `rtoml.loads` if you give it a `str`. https://github.com/samuelcolvin/rtoml/blob/d79d03faad6d473f2482319365445a50c0df4e18/rtoml/__init__.py#L16-L26

It's fixed, at least on my end. I think we can close it now.

I think this issue is also related to prometheus/node_exporter#2356. IMO it's better to graceful shutdown the server instead of exiting 0 directly, and then return to the caller of `ListenAndServe`...