mirror of
https://github.com/Luzifer/bind-log-metrics.git
synced 2024-12-22 12:01:18 +00:00
Handle metrics errors, prevent blocking err chan
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
0c248599e0
commit
426bd3fb85
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -63,6 +63,12 @@ func main() {
|
|||
log.WithError(err).Fatal("Unable to create metrics client")
|
||||
}
|
||||
|
||||
go func() {
|
||||
for err := range metrics.Errors() {
|
||||
log.WithError(err).Error("Metrics processing caused an error")
|
||||
}
|
||||
}()
|
||||
|
||||
var input io.Reader = os.Stdin
|
||||
if len(rconfig.Args()) > 1 {
|
||||
f, err := os.Open(rconfig.Args()[1])
|
||||
|
|
Loading…
Reference in a new issue