🐛 时间超出int范围

This commit is contained in:
微凉
2020-12-26 18:11:17 +08:00
parent 52cddc431a
commit 4af469efed
9 changed files with 86 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ import (
)
func InitAliDrive() bool {
log.Infof("初始化阿里云盘...")
//首先token_login
if conf.Conf.AliDrive.RefreshToken == "" {
tokenLogin,err:=alidrive.TokenLogin()

View File

@@ -2,9 +2,11 @@ package bootstrap
import (
"github.com/Xhofe/alist/conf"
log "github.com/sirupsen/logrus"
"net/http"
)
func InitClient() {
log.Infof("初始化client...")
conf.Client=&http.Client{}
}

View File

@@ -39,11 +39,11 @@ func printASC() {
func start() {
InitLog()
printASC()
InitClient()
if !ReadConf(conf.Con) {
log.Errorf("读取配置文件时出现错误,启动失败.")
return
}
InitClient()
if !InitAliDrive() {
log.Errorf("初始化阿里云盘出现错误,启动失败.")
return
@@ -54,9 +54,9 @@ func start() {
func server() {
baseServer:="0.0.0.0:"+conf.Conf.Server.Port
log.Infof("Starting server @ %s",baseServer)
r:=gin.Default()
serv.InitRouter(r)
log.Infof("Starting server @ %s",baseServer)
err:=r.Run(baseServer)
if err!=nil {
log.Errorf("Server failed start:%s",err.Error())

View File

@@ -9,6 +9,7 @@ import (
)
func ReadConf(config string) bool {
log.Infof("读取配置文件...")
if !utils.Exists(config) {
log.Infof("找不到配置文件:%s",config)
return false