mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-01-03 17:59:12 +08:00
✏️ 修复 sql 加载失败
This commit is contained in:
parent
0e026a8b3b
commit
37e36fb886
@ -5,11 +5,15 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/utils/process"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
log.Println("[vtb/cron] 开启vtb数据库日常更新")
|
go func() {
|
||||||
vtbDaily()
|
process.SleepAbout1sTo2s()
|
||||||
|
log.Println("[vtb/cron] 开启vtb数据库日常更新")
|
||||||
|
vtbDaily()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func vtbDaily() {
|
func vtbDaily() {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ type Sqlite struct {
|
|||||||
// 返回错误
|
// 返回错误
|
||||||
func (db *Sqlite) Create(table string, objptr interface{}) (err error) {
|
func (db *Sqlite) Create(table string, objptr interface{}) (err error) {
|
||||||
if db.DB == nil {
|
if db.DB == nil {
|
||||||
database, err := sql.Open("sqlite", db.DBPath)
|
database, err := sql.Open("sqlite3", db.DBPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user