Skip to content

Commit

Permalink
add new flag as type of dmsg servers that sd should connect for handl…
Browse files Browse the repository at this point in the history
…e dmsghttp logic
  • Loading branch information
mrpalide committed Sep 9, 2024
1 parent a268b10 commit 82b9d26
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/service-discovery/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
testEnvironment bool
sk cipher.SecKey
dmsgPort uint16
dmsgServerType string
)

func init() {
Expand All @@ -59,6 +60,7 @@ func init() {
RootCmd.Flags().BoolVarP(&testMode, "test", "t", false, "run in test mode and disable auth")
RootCmd.Flags().StringVarP(&apiKey, "api-key", "g", "", "geo API key")
RootCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "d", skyenv.DmsgDiscAddr, "url of dmsg-discovery")
RootCmd.Flags().StringVar(&dmsgServerType, "dmsg-server-type", "", "type of dmsg server on dmsghttp connected")
RootCmd.Flags().BoolVarP(&testEnvironment, "test-environment", "n", false, "distinguished between prod and test environment")
RootCmd.Flags().VarP(&sk, "sk", "s", "dmsg secret key\n")
RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value")
Expand Down Expand Up @@ -173,8 +175,9 @@ PG_USER="postgres" PG_DATABASE="sd" PG_PASSWORD="" service-discovery --sk $(tail
if !pk.Null() {
servers := dmsghttp.GetServers(ctx, dmsgDisc, log)
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,
}
var keys cipher.PubKeys
keys = append(keys, pk)
Expand Down

0 comments on commit 82b9d26

Please sign in to comment.