Skip to content

Commit

Permalink
修改定时模块只能定时一次的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoxusheng committed Jul 23, 2023
1 parent b22eba4 commit 43d413b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions GoBat.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2023/06/28 16:29:28 [INFO]: Go-Bat v0.1 机器人启动
2023/06/28 16:30:29 [INFO]: Go-Bat v0.1 机器人启动
2023/06/28 16:34:28 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 08:21:50 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 08:22:14 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 08:22:58 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 08:44:04 [INFO]: Go-22g v0.2 机器人启动
2023/07/23 08:46:51 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 08:47:28 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 08:49:00 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 09:51:47 [INFO]: Go-Bat v0.2 机器人启动
2023/07/23 09:52:56 [INFO]: Go-Bat v0.2 机器人启动
9 changes: 7 additions & 2 deletions config/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ import (
var Rdb *redis.Client

func init() {

client := redis.NewClient(&redis.Options{
Addr: K.Redis.Addr,
Password: K.Redis.Password, // no password set
DB: K.Redis.DB, // uses default DB
PoolSize: K.Redis.PoolSize,
})
ctx := context.Background()

ping := client.Ping(ctx)
if ping.String() == "ping: PONG" {
//fmt.Println(ping.String())
log.Println("连接redis 成功!")
Rdb = client
}
Rdb = client
log.Println("连接redis失败")

//panic("连接失败")

}
Binary file modified config/t.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 43d413b

Please sign in to comment.