mirror of
https://github.com/ProudMuBai/GoFilm.git
synced 2026-05-17 10:47:30 +08:00
server modifity
This commit is contained in:
@@ -5,11 +5,12 @@ import (
|
|||||||
"server/plugin/db"
|
"server/plugin/db"
|
||||||
"server/plugin/spider"
|
"server/plugin/spider"
|
||||||
"server/router"
|
"server/router"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// 执行初始化前等待20s , 让mysql服务完成初始化指令
|
// 执行初始化前等待20s , 让mysql服务完成初始化指令
|
||||||
//time.Sleep(time.Second * 20)
|
time.Sleep(time.Second * 20)
|
||||||
//初始化redis客户端
|
//初始化redis客户端
|
||||||
err := db.InitRedisConn()
|
err := db.InitRedisConn()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -23,7 +24,6 @@ func init() {
|
|||||||
}
|
}
|
||||||
func main() {
|
func main() {
|
||||||
start()
|
start()
|
||||||
//spider.MtSiteSpider()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func start() {
|
func start() {
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ func GetMultiplePlay(siteName, key string) []MovieUrlInfo {
|
|||||||
// DataCache API请求 数据缓存
|
// DataCache API请求 数据缓存
|
||||||
func DataCache(key string, data map[string]interface{}) {
|
func DataCache(key string, data map[string]interface{}) {
|
||||||
val, _ := json.Marshal(data)
|
val, _ := json.Marshal(data)
|
||||||
db.Rdb.Set(db.Cxt, key, val, config.CategoryTreeExpired)
|
db.Rdb.Set(db.Cxt, key, val, time.Minute*30)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCacheData 获取API接口的缓存数据
|
// GetCacheData 获取API接口的缓存数据
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ import (
|
|||||||
"server/plugin/db"
|
"server/plugin/db"
|
||||||
"server/plugin/spider"
|
"server/plugin/spider"
|
||||||
"server/router"
|
"server/router"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// 执行初始化前等待20s , 让mysql服务完成初始化指令
|
// 执行初始化前等待20s , 让mysql服务完成初始化指令
|
||||||
//time.Sleep(time.Second * 20)
|
time.Sleep(time.Second * 20)
|
||||||
//初始化redis客户端
|
//初始化redis客户端
|
||||||
err := db.InitRedisConn()
|
err := db.InitRedisConn()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -23,7 +24,6 @@ func init() {
|
|||||||
}
|
}
|
||||||
func main() {
|
func main() {
|
||||||
start()
|
start()
|
||||||
//spider.MtSiteSpider()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func start() {
|
func start() {
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ func GetMultiplePlay(siteName, key string) []MovieUrlInfo {
|
|||||||
// DataCache API请求 数据缓存
|
// DataCache API请求 数据缓存
|
||||||
func DataCache(key string, data map[string]interface{}) {
|
func DataCache(key string, data map[string]interface{}) {
|
||||||
val, _ := json.Marshal(data)
|
val, _ := json.Marshal(data)
|
||||||
db.Rdb.Set(db.Cxt, key, val, config.CategoryTreeExpired)
|
db.Rdb.Set(db.Cxt, key, val, time.Minute*30)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCacheData 获取API接口的缓存数据
|
// GetCacheData 获取API接口的缓存数据
|
||||||
|
|||||||
Reference in New Issue
Block a user