Skip to content

Commit

Permalink
fix: configurable extractor address
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Oct 20, 2023
1 parent 2c09e07 commit 11cb63b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,6 @@ func initializeDefaults() {
viper.SetDefault("virustotal.key", "")

viper.SetDefault("feature_flags.allow_multi_target_upload", false)

viper.SetDefault("extractor_host", "localhost:50051")
}
3 changes: 2 additions & 1 deletion validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/spf13/viper"

Check failure on line 11 in validation/validation.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gci`-ed with --skip-generated -s standard,default,prefix(github.com/satisfactorymodding/smr-api),blank,dot (gci)
"io"
"path"
"path/filepath"
Expand Down Expand Up @@ -134,7 +135,7 @@ func ExtractModInfo(ctx context.Context, body []byte, withMetadata bool, withVal

if withMetadata {
// Extract all possible metadata
conn, err := grpc.Dial("localhost:50051", grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.Dial(viper.GetString("extractor_host"), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, errors.Wrap(err, "failed to connect to metadata server")
}
Expand Down

0 comments on commit 11cb63b

Please sign in to comment.