Skip to content

Commit

Permalink
feat: move validate code in upper runServer func
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Luthfi Fahlevi committed Sep 2, 2024
1 parent 546644e commit 0f0b609
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cli/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ func serverMigrateCommand(cfg *Config) *cobra.Command {
}

func runServer(ctx context.Context, cfg *Config) error {
if err := cfg.Asset.Validate(); err != nil {
return err
}

logger := initLogger(cfg.LogLevel)
logger.Info("compass starting", "version", Version)

Expand Down Expand Up @@ -148,10 +152,6 @@ func runServer(ctx context.Context, cfg *Config) error {
}
}()

if err = cfg.Asset.Validate(); err != nil {
return err
}

assetService, cancel := asset.NewService(asset.ServiceDeps{
AssetRepo: assetRepository,
DiscoveryRepo: discoveryRepository,
Expand Down

0 comments on commit 0f0b609

Please sign in to comment.