增加定时任务 处理异常

This commit is contained in:
2024-08-30 11:55:19 +08:00
parent aa3f9e8711
commit bfb284c4cc
30 changed files with 945 additions and 336 deletions

View File

@@ -0,0 +1,31 @@
package init_db_data
import (
"fmt"
"os"
)
type InitDBFunc interface {
Init() (err error)
}
// 初始化数据库
func initDB(InitDBFunctions ...InitDBFunc) (err error) {
for _, v := range InitDBFunctions {
err = v.Init()
if err != nil {
return err
}
}
return nil
}
func InitDbData() {
err := initDB(initPeakValleyTimeBlockData)
if err != nil {
fmt.Println("[-]初始化基础数据失败:", err)
os.Exit(0)
}
}
//