mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +08:00
24 lines
389 B
Go
24 lines
389 B
Go
package sleepmanage
|
|
|
|
import (
|
|
"os"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_sleep_manage/model"
|
|
"github.com/FloatTech/zbputils/process"
|
|
)
|
|
|
|
func init() {
|
|
go func() {
|
|
defer func() {
|
|
if err := recover(); err != nil {
|
|
log.Println(err)
|
|
}
|
|
}()
|
|
process.SleepAbout1sTo2s()
|
|
_ = os.MkdirAll(dbpath, 0755)
|
|
model.Initialize(dbfile)
|
|
}()
|
|
}
|