mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 15:44:01 +03:00
Rework stats server
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user