Rework stats server

This commit is contained in:
9seconds
2018-10-16 22:17:46 +03:00
parent 7c463851b2
commit c74e0ee359
6 changed files with 169 additions and 178 deletions
+22
View File
@@ -0,0 +1,22 @@
package stats
import (
"github.com/juju/errors"
"github.com/9seconds/mtg/config"
)
func Init(conf *config.Config) error {
if conf.StatsD.Enabled {
client, err := newStatsd(conf)
if err != nil {
return errors.Annotate(err, "Cannot initialize statsd client")
}
go client.run()
}
go NewStats(conf).start()
go startServer(conf)
return nil
}