chore: separate serve function
rabbitprincess committed
Mar 21, 2026 at 20:23 UTC
3c3f3aebc1edfc9da02acf2d7a0c7f24e76e85bf
1 file changed
+5
cmd/relay-server/main.go
+5
@@ -1,6 +1,7 @@
1
package main
2
3
import (
4
+ "context"
5
"errors"
6
"flag"
7
"fmt"
@@ -98,6 +99,10 @@ func runServeCommand(args []string) error {
99
ctx, stop := utils.SignalContext()
100
defer stop()
101
102
+ return runServer(ctx, cfg)
103
+}
104
+
105
+func runServer(ctx context.Context, cfg relayServerConfig) error {
106
server, err := portal.NewServer(portal.ServerConfig{
107
PortalURL: cfg.PortalURL,
108
OwnerPrivateKey: cfg.OwnerPrivateKey,