1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

fmt & fix do_restart

This commit is contained in:
wdvxdr 2020-11-09 23:17:36 +08:00
parent c2c7b96f1b
commit f59ce1480e
4 changed files with 5 additions and 4 deletions

View File

@ -42,7 +42,7 @@ func NewQQBot(cli *client.QQClient, conf *global.JsonConfig) *CQBot {
p := path.Join("data", "leveldb")
db, err := leveldb.OpenFile(p, nil)
if err != nil {
log.Fatalf("打开数据库失败, 如果频繁遇到此问题请清理 data/db 文件夹或关闭数据库功能。")
log.Fatalf("打开数据库失败, 如果频繁遇到此问题请清理 data/leveldb 文件夹或关闭数据库功能。")
}
bot.db = db
gob.Register(message.Sender{})

View File

@ -95,7 +95,7 @@ func main() {
console := bufio.NewReader(os.Stdin)
arg := os.Args
if len(arg) >1 && arg[1] == "update"{
if len(arg) > 1 && arg[1] == "update" {
if len(arg) > 2 {
selfUpdate(arg[2])
} else {

View File

@ -406,6 +406,7 @@ func (s *webServer) ReloadServer() {
// 热重启
func AdminDoRestart(s *webServer, c *gin.Context) {
s.bot.Release()
s.bot = nil
s.Cli = nil
s.DoReLogin()