Skip to content

Commit 2bb3bdc

Browse files
committed
chore(deps): bump sentinel-go-sdk to commit b37c50d18c9c
1 parent 8e75ac3 commit 2bb3bdc

File tree

4 files changed

+65
-19
lines changed

4 files changed

+65
-19
lines changed

cmd/start.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ explicitly starts the node, and handles SIGINT/SIGTERM for graceful shutdown.`,
5252

5353
// Goroutine to start and wait on the node
5454
eg.Go(func() error {
55+
log.Info("Starting node")
5556
if err := n.Start(); err != nil {
5657
return fmt.Errorf("starting node: %w", err)
5758
}
@@ -67,6 +68,8 @@ explicitly starts the node, and handles SIGINT/SIGTERM for graceful shutdown.`,
6768
// Goroutine to handle graceful shutdown on signal
6869
eg.Go(func() error {
6970
<-ctx.Done()
71+
72+
log.Info("Stopping node")
7073
if err := n.Stop(); err != nil {
7174
return app.NewErrShutdown(err)
7275
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/cosmos/cosmos-sdk v0.47.17
88
github.com/gin-contrib/cors v1.7.6
99
github.com/gin-gonic/gin v1.10.1
10-
github.com/sentinel-official/sentinel-go-sdk v1.0.0-rc.6.0.20250905191443-7f1ad4500a31
10+
github.com/sentinel-official/sentinel-go-sdk v1.0.0-rc.6.0.20250906120819-b37c50d18c9c
1111
github.com/sentinel-official/sentinelhub/v12 v12.0.0-rc.11
1212
github.com/spf13/cobra v1.10.1
1313
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ github.com/secure-io/siv-go v0.0.0-20180922214919-5ff40651e2c4 h1:zOjq+1/uLzn/Xo
512512
github.com/secure-io/siv-go v0.0.0-20180922214919-5ff40651e2c4/go.mod h1:aI+8yClBW+1uovkHw6HM01YXnYB8vohtB9C83wzx34E=
513513
github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb h1:XfLJSPIOUX+osiMraVgIrMR27uMXnRJWGm1+GL8/63U=
514514
github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg=
515-
github.com/sentinel-official/sentinel-go-sdk v1.0.0-rc.6.0.20250905191443-7f1ad4500a31 h1:S9Ke0TWzdgRPalNujceE8kQXyLQBodrVOix7mnWdfdQ=
516-
github.com/sentinel-official/sentinel-go-sdk v1.0.0-rc.6.0.20250905191443-7f1ad4500a31/go.mod h1:dgPFIfSccQ1th9xdwUGnMsdatGpYTA6p13SEbSX4UB8=
515+
github.com/sentinel-official/sentinel-go-sdk v1.0.0-rc.6.0.20250906120819-b37c50d18c9c h1:Q7s7BGAzr7LwS9j5pX5/gjdmcbbfj2zqeH4ZmT/SzJ0=
516+
github.com/sentinel-official/sentinel-go-sdk v1.0.0-rc.6.0.20250906120819-b37c50d18c9c/go.mod h1:dgPFIfSccQ1th9xdwUGnMsdatGpYTA6p13SEbSX4UB8=
517517
github.com/sentinel-official/sentinelhub/v12 v12.0.0-rc.11 h1:B3ylnKZSLP9aDYnS2f98Gx/QTohPuD36tjl75kYJSMs=
518518
github.com/sentinel-official/sentinelhub/v12 v12.0.0-rc.11/go.mod h1:LXcOAEffAn4Pw58xhoYN9j8ZVuM02OCgPNTI6lkGG2E=
519519
github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970=

node/node.go

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/sentinel-official/sentinel-go-sdk/libs/log"
1010
"github.com/sentinel-official/sentinel-go-sdk/process"
1111
"github.com/sentinel-official/sentinelhub/v12/x/node/types/v3"
12+
"golang.org/x/sync/errgroup"
1213

1314
"github.com/sentinel-official/sentinel-dvpnx/core"
1415
)
@@ -125,16 +126,37 @@ func (n *Node) UpdateDetails(ctx context.Context) error {
125126
// Start initializes the Node's services, scheduler, and API server.
126127
func (n *Node) Start() error {
127128
return n.Manager.Start(func(ctx context.Context) error {
128-
if err := n.Context().Service().Start(); err != nil {
129-
return fmt.Errorf("starting service: %w", err)
130-
}
129+
sg := &errgroup.Group{}
131130

132-
if err := n.Scheduler().Start(); err != nil {
133-
return fmt.Errorf("starting scheduler: %w", err)
134-
}
131+
sg.Go(func() error {
132+
log.Info("Starting service")
133+
if err := n.Context().Service().Start(); err != nil {
134+
return fmt.Errorf("starting service: %w", err)
135+
}
136+
137+
return nil
138+
})
139+
140+
sg.Go(func() error {
141+
log.Info("Starting scheduler")
142+
if err := n.Scheduler().Start(); err != nil {
143+
return fmt.Errorf("starting scheduler: %w", err)
144+
}
145+
146+
return nil
147+
})
148+
149+
sg.Go(func() error {
150+
log.Info("Starting API server")
151+
if err := n.Server().Start(); err != nil {
152+
return fmt.Errorf("starting API server: %w", err)
153+
}
154+
155+
return nil
156+
})
135157

136-
if err := n.Server().Start(); err != nil {
137-
return fmt.Errorf("starting API server: %w", err)
158+
if err := sg.Wait(); err != nil {
159+
return err
138160
}
139161

140162
if err := n.Register(ctx); err != nil {
@@ -181,16 +203,37 @@ func (n *Node) Wait() error {
181203
// Stop gracefully stops the Node's operations.
182204
func (n *Node) Stop() error {
183205
return n.Manager.Stop(func() error {
184-
if err := n.Context().Service().Stop(); err != nil {
185-
return fmt.Errorf("stopping service: %w", err)
186-
}
206+
sg := &errgroup.Group{}
187207

188-
if err := n.Scheduler().Stop(); err != nil {
189-
return fmt.Errorf("stopping scheduler: %w", err)
190-
}
208+
sg.Go(func() error {
209+
log.Info("Stopping service")
210+
if err := n.Context().Service().Stop(); err != nil {
211+
return fmt.Errorf("stopping service: %w", err)
212+
}
213+
214+
return nil
215+
})
216+
217+
sg.Go(func() error {
218+
log.Info("Stopping scheduler")
219+
if err := n.Scheduler().Stop(); err != nil {
220+
return fmt.Errorf("stopping scheduler: %w", err)
221+
}
222+
223+
return nil
224+
})
225+
226+
sg.Go(func() error {
227+
log.Info("Stopping API server")
228+
if err := n.Server().Stop(); err != nil {
229+
return fmt.Errorf("stopping API server: %w", err)
230+
}
231+
232+
return nil
233+
})
191234

192-
if err := n.Server().Stop(); err != nil {
193-
return fmt.Errorf("stopping API server: %w", err)
235+
if err := sg.Wait(); err != nil {
236+
return err
194237
}
195238

196239
return nil

0 commit comments

Comments
 (0)