|
@@ -4,8 +4,11 @@ package main
|
|
|
import (
|
|
|
"crypto/md5"
|
|
|
"encoding/hex"
|
|
|
+ _ "filter"
|
|
|
"front"
|
|
|
"log"
|
|
|
+ "qfw/util/redis"
|
|
|
+ "time"
|
|
|
|
|
|
qu "qfw/util"
|
|
|
"strings"
|
|
@@ -24,9 +27,8 @@ func init() {
|
|
|
//os.Exit(0)
|
|
|
qu.ReadConfig(&util.Config)
|
|
|
util.InitConfig()
|
|
|
- //util.InitInfluxdb(util.Config.InfluxdbUrl)
|
|
|
//redis
|
|
|
- //redis.InitRedis(util.Config.Redis)
|
|
|
+ redis.InitRedis(util.Config.Redis)
|
|
|
//oss
|
|
|
util.InitOss()
|
|
|
//xweb框架配置
|
|
@@ -36,29 +38,14 @@ func init() {
|
|
|
xweb.RootApp().AppConfig.StaticDir = "web/staticres"
|
|
|
xweb.RootApp().AppConfig.StaticFileVersion = false
|
|
|
xweb.RootApp().AppConfig.CheckXsrf = false
|
|
|
- xweb.RootApp().AppConfig.ReloadTemplates = false
|
|
|
+ xweb.RootApp().AppConfig.ReloadTemplates = true
|
|
|
xweb.RootApp().AppConfig.EnableHttpCache = false
|
|
|
xweb.RootApp().AppConfig.Mode = xweb.Product
|
|
|
xweb.RootApp().AppConfig.CacheTemplates = false
|
|
|
+ xweb.RootApp().AppConfig.SessionTimeout = 3 * time.Hour
|
|
|
xweb.AddAction(&front.Front{})
|
|
|
//_id初始化内存
|
|
|
log.Println("_id初始化内存...")
|
|
|
- //front.IdList = list.New()
|
|
|
-
|
|
|
- //加载所有数据,存入IdList
|
|
|
- //ls, _ := util.MgoM.Find(util.Config.Fromtable, `{"check":{"$exists":0}}`, nil, `{"_id":1}`, false, -1, -1)
|
|
|
- //ls, _ := util.MgoM.Find(util.Coll, nil, nil, `{"_id":1}`, false, -1, -1)
|
|
|
- //for _, v := range *ls {
|
|
|
- // front.IdList.PushBack(mgo.BsonIdToSId(v["_id"]))
|
|
|
- //}
|
|
|
- //qu.Debug("_id初始化内存完成", front.IdList.Len())
|
|
|
- // front.IdPackList = list.New()
|
|
|
- // //加载所有未标注数据且含有分包信息的数据
|
|
|
- // lspack, _ := util.MgoM.Find(util.Config.Fromtable, `{"check":{"$exists":0},"package":{"$exists":1}}`, nil, `{"_id":1}`, false, -1, -1)
|
|
|
- // for _, v := range *lspack {
|
|
|
- // front.IdPackList.PushBack(mgo.BsonIdToSId(v["_id"]))
|
|
|
- // }
|
|
|
- // log.Println("_id初始化内存完成_分包", front.IdPackList.Len())
|
|
|
}
|
|
|
|
|
|
func main() {
|