Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: not update token when http port already bind #367

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func runAction(cctx *cli.Context) error {
log.Infof("auth info url: %s\n", cfg.JWT.AuthURL)
log.Infof("gateway info url: %s, token: %s\n", cfg.Gateway.Url, cfg.Gateway.Token)
log.Infof("rate limit info: redis: %s \n", cfg.RateLimit.Redis)
log.Infof("defalut timeout: %v, sign message timeout: %v, estimate message timeout: %v", cfg.MessageService.DefaultTimeout,
log.Infof("default timeout: %v, sign message timeout: %v, estimate message timeout: %v", cfg.MessageService.DefaultTimeout,
cfg.MessageService.SignMessageTimeout, cfg.MessageService.EstimateMessageTimeout)

remoteAuthCli, err := jwtclient.NewAuthClient(cfg.JWT.AuthURL, cfg.JWT.Token)
Expand All @@ -180,11 +180,6 @@ func runAction(cctx *cli.Context) error {
return fmt.Errorf("failed to generate local auth client %v", err)
}

err = fsRepo.SaveToken(token)
if err != nil {
return fmt.Errorf("failed to save token %v", err)
}

client, closer, err := v1.DialFullNodeRPC(ctx, cfg.Node.Url, cfg.Node.Token, nil)
if err != nil {
return fmt.Errorf("connect to node failed %v", err)
Expand Down Expand Up @@ -251,6 +246,11 @@ func runAction(cctx *cli.Context) error {
}
lst := manet.NetListener(apiListener)

err = fsRepo.SaveToken(token)
if err != nil {
return fmt.Errorf("failed to save token %v", err)
}

provider := fx.Options(
fx.Logger(fxLogger{}),
// prover
Expand Down
Loading