forked from gsn/predictor
updated downloader
This commit is contained in:
parent
ca95e06ab7
commit
8e9f117799
30 changed files with 1209 additions and 698 deletions
36
scripts/test_download.go
Normal file
36
scripts/test_download.go
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.intra.yksa.space/gsn/predictor/internal/pkg/grib"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
// Найти последний доступный прогноз
|
||||
run, err := grib.GetLatestModelRun(ctx)
|
||||
if err != nil {
|
||||
fmt.Printf("Error finding model run: %v\n", err)
|
||||
return
|
||||
}
|
||||
fmt.Printf("Found model run: %v\n", run)
|
||||
|
||||
// Создать downloader
|
||||
dl := grib.NewPartialDownloader("C:/tmp/grib", 8)
|
||||
|
||||
// Запустить загрузку
|
||||
start := time.Now()
|
||||
fmt.Println("Starting download...")
|
||||
|
||||
err = dl.Run(ctx, run)
|
||||
if err != nil {
|
||||
fmt.Printf("Download error: %v\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("Download completed in %v\n", time.Since(start))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue