Revert "feat: 新增雷达图"
This reverts commit 6bc0610c2deb96b8527047c657acf0f1f594d6a1.
This commit is contained in:
parent
cfb0bca723
commit
2c7f9a0f47
@ -10,7 +10,6 @@ import (
|
||||
"weatherstation/internal/config"
|
||||
"weatherstation/internal/database"
|
||||
"weatherstation/internal/forecast"
|
||||
"weatherstation/internal/radarfetch"
|
||||
"weatherstation/internal/selftest"
|
||||
"weatherstation/internal/server"
|
||||
"weatherstation/internal/tools"
|
||||
@ -223,36 +222,9 @@ func main() {
|
||||
}()
|
||||
}
|
||||
|
||||
// 启动雷达抓取(后台定时)
|
||||
startRadarBackground := func(wg *sync.WaitGroup) {
|
||||
if wg != nil {
|
||||
wg.Add(1)
|
||||
}
|
||||
go func() {
|
||||
defer func() {
|
||||
if wg != nil {
|
||||
wg.Done()
|
||||
}
|
||||
}()
|
||||
log.Println("启动雷达抓取任务(10分钟)...")
|
||||
opts := radarfetch.Options{
|
||||
OutRoot: "./radar_data",
|
||||
TZOffset: 8,
|
||||
Interval: 10 * time.Minute,
|
||||
NMCChinaURL: "https://www.nmc.cn/publish/radar/chinaall.html",
|
||||
NMCHuananURL: "https://www.nmc.cn/publish/radar/huanan.html",
|
||||
NMCNanningURL: "https://www.nmc.cn/publish/radar/guang-xi/nan-ning.htm",
|
||||
CMABase: "https://image.data.cma.cn",
|
||||
Z: 7, Y: 40, X: 102,
|
||||
}
|
||||
radarfetch.Run(opts)
|
||||
}()
|
||||
}
|
||||
|
||||
if *webOnly {
|
||||
// 只启动Web服务器 + 导出器
|
||||
startExporterBackground(nil)
|
||||
startRadarBackground(nil)
|
||||
log.Println("启动Web服务器模式...")
|
||||
if err := server.StartGinServer(); err != nil {
|
||||
log.Fatalf("启动Web服务器失败: %v", err)
|
||||
@ -260,7 +232,6 @@ func main() {
|
||||
} else if *udpOnly {
|
||||
// 只启动UDP服务器 + 导出器
|
||||
startExporterBackground(nil)
|
||||
startRadarBackground(nil)
|
||||
log.Println("启动UDP服务器模式...")
|
||||
if err := server.StartUDPServer(); err != nil {
|
||||
log.Fatalf("启动UDP服务器失败: %v", err)
|
||||
@ -291,7 +262,6 @@ func main() {
|
||||
}()
|
||||
|
||||
startExporterBackground(&wg)
|
||||
startRadarBackground(&wg)
|
||||
wg.Wait()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user