mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-12 14:28:37 -07:00
Separate tracker logic from the http package, step 1
This commit is contained in:
10
chihaya.go
10
chihaya.go
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user