Separate tracker logic from the http package, step 1

This commit is contained in:
Justin Li
2014-07-17 00:09:56 -04:00
parent f8047ef8ab
commit da19ed3e21
21 changed files with 568 additions and 503 deletions

View File

@@ -14,10 +14,11 @@ import (
"github.com/chihaya/chihaya/config"
"github.com/chihaya/chihaya/http"
"github.com/chihaya/chihaya/tracker"
// See the README for how to import custom drivers.
_ "github.com/chihaya/chihaya/drivers/backend/noop"
_ "github.com/chihaya/chihaya/drivers/tracker/memory"
_ "github.com/chihaya/chihaya/tracker/memory"
)
var (
@@ -67,6 +68,11 @@ func Boot() {
glog.V(1).Infof("Loaded config file: %s", configPath)
}
http.Serve(cfg)
tkr, err := tracker.New(cfg)
if err != nil {
glog.Fatal("New: ", err)
}
http.Serve(cfg, tkr)
glog.Info("Gracefully shut down")
}