Skip to content

Commit

Permalink
Merge pull request #29 from mrpalide/fix/improve-logic-of-dmsghttp
Browse files Browse the repository at this point in the history
improve dmsghttp handler logic
  • Loading branch information
mrpalide authored Sep 9, 2024
2 parents a268b10 + 214964d commit 3ef643a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup golang
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.22.x
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Requirements
run: |
sudo apt update
Expand Down
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 handler")
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 3ef643a

Please sign in to comment.