Skip to content

Commit

Permalink
add --dmsg-server-type flag to tpd
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpalide committed Sep 9, 2024
1 parent 50aa633 commit e101467
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/transport-discovery/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var (
testEnvironment bool
sk cipher.SecKey
dmsgPort uint16
dmsgServerType string
pgMaxOpenConn int
)

Expand All @@ -70,6 +71,7 @@ func init() {
RootCmd.Flags().BoolVar(&testEnvironment, "test-environment", false, "distinguished between prod and test environment\033[0m")
RootCmd.Flags().Var(&sk, "sk", "dmsg secret key\r")
RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r")
RootCmd.Flags().StringVar(&dmsgServerType, "dmsg-server-type", "", "type of dmsg server on dmsghttp handler")
}

// RootCmd contains the root command
Expand Down Expand Up @@ -204,8 +206,9 @@ PG_USER="postgres" PG_DATABASE="tpd" PG_PASSWORD="" transport-discovery --sk $(t
keys = append(keys, pk)
dClient := direct.NewClient(direct.GetAllEntries(keys, servers), logger)
config := &dmsg.Config{
MinSessions: 0, // listen on all available servers
UpdateInterval: dmsg.DefaultUpdateInterval,
MinSessions: 0, // listen on all available servers
UpdateInterval: dmsg.DefaultUpdateInterval,
ConnectedServersType: dmsgServerType,
}

dmsgDC, closeDmsgDC, err := direct.StartDmsg(ctx, logger, pk, sk, dClient, config)
Expand Down

0 comments on commit e101467

Please sign in to comment.