feat: remove redis
This commit is contained in:
parent
7a9f81e527
commit
a850615e1f
18 changed files with 170 additions and 1142 deletions
|
|
@ -14,7 +14,6 @@ import (
|
|||
"git.intra.yksa.space/gsn/predictor/internal/service"
|
||||
"git.intra.yksa.space/gsn/predictor/internal/transport/rest"
|
||||
"git.intra.yksa.space/gsn/predictor/internal/transport/rest/handler"
|
||||
"git.intra.yksa.space/gsn/predictor/pkg/redis"
|
||||
"git.intra.yksa.space/gsn/predictor/pkg/scheduler"
|
||||
env "github.com/caarlos0/env/v11"
|
||||
"go.uber.org/zap"
|
||||
|
|
@ -45,23 +44,10 @@ func main() {
|
|||
log.Ctx(ctx).Fatal("failed to load GRIB updater configuration", zap.Error(err))
|
||||
}
|
||||
|
||||
log.Ctx(ctx).Info("Connecting to Redis", zap.String("host", cfg.RedisHost), zap.Int("port", cfg.RedisPort))
|
||||
redisService, err := redis.New(redis.Config{
|
||||
Host: cfg.RedisHost,
|
||||
Port: cfg.RedisPort,
|
||||
Password: cfg.RedisPassword,
|
||||
DB: cfg.RedisDB,
|
||||
})
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Fatal("failed to initialize Redis service", zap.Error(err), zap.String("host", cfg.RedisHost), zap.Int("port", cfg.RedisPort))
|
||||
}
|
||||
defer redisService.Close()
|
||||
|
||||
gribService, err := grib.New(grib.ServiceConfig{
|
||||
Dir: cfg.GribDir,
|
||||
TTL: cfg.GribTTL,
|
||||
CacheTTL: cfg.GribCacheTTL,
|
||||
Redis: redisService,
|
||||
Parallel: cfg.GribParallel,
|
||||
Client: cfg.CreateHTTPClient(),
|
||||
DatasetURL: cfg.GribDatasetURL,
|
||||
|
|
@ -81,7 +67,7 @@ func main() {
|
|||
}
|
||||
}()
|
||||
|
||||
svc, err := service.New(cfg, gribService, redisService)
|
||||
svc, err := service.New(cfg, gribService)
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Fatal("failed to initialize service", zap.Error(err))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue