From 939e32959151e47cdf9ed3b1dde6901819813542 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 22 Feb 2024 03:23:06 -0500 Subject: [PATCH] fix: need to update config management in renter pkg --- renter/renter.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/renter/renter.go b/renter/renter.go index aef74e4..30df8e6 100644 --- a/renter/renter.go +++ b/renter/renter.go @@ -10,9 +10,10 @@ import ( "strconv" "strings" + "git.lumeweb.com/LumeWeb/portal/config" + "git.lumeweb.com/LumeWeb/portal/cron" "github.com/google/uuid" - "github.com/spf13/viper" rhpv2 "go.sia.tech/core/rhp/v2" "go.sia.tech/renterd/api" busClient "go.sia.tech/renterd/bus/client" @@ -27,7 +28,7 @@ type UploadIDHandler func(uploadID string) type RenterServiceParams struct { fx.In - Config *viper.Viper + Config *config.Manager Logger *zap.Logger Cron *cron.CronServiceDefault } @@ -35,7 +36,7 @@ type RenterServiceParams struct { type RenterDefault struct { busClient *busClient.Client workerClient *workerClient.Client - config *viper.Viper + config *config.Manager logger *zap.Logger cron *cron.CronServiceDefault } @@ -101,8 +102,8 @@ func (r *RenterDefault) UploadObject(ctx context.Context, file io.Reader, bucket } func (r *RenterDefault) init() error { - addr := r.config.GetString("core.sia.url") - passwd := r.config.GetString("core.sia.key") + addr := r.config.Config().Core.Sia.URL + passwd := r.config.Config().Core.Sia.Key addrURL, err := url.Parse(addr)