You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

48 lines
715 B

package main
import (
"git.fuyu.moe/5GPowerQuality/parser/data"
"git.fuyu.moe/5GPowerQuality/parser/envitron"
"git.fuyu.moe/5GPowerQuality/parser/fortop"
"git.fuyu.moe/5GPowerQuality/parser/fortoprt"
"git.fuyu.moe/Fuyu/flog"
)
func main() {
defer recoverFunc()
setLogger()
flog.Info(`Starting`)
catchSignals()
data.InitDB()
go fetchFortopData()
go fetchFortopRealtimeData()
envitron.ReceiveData()
}
func recoverFunc() {
v := recover()
if v != nil {
flog.Critical(`panic: `, v)
}
}
func fetchFortopData() {
for {
func() {
defer recoverFunc()
fortop.FetchData()
}()
}
}
func fetchFortopRealtimeData() {
for {
func() {
defer recoverFunc()
fortoprt.FetchData()
}()
}
}