Skip to content

Commit

Permalink
stop properly
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Jun 6, 2024
1 parent 7974fe1 commit edb122c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions protocol/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ func New(
if app.SlinkyClient != nil {
app.SlinkyClient.Stop()
}
if app.GrpcStreamingManager != nil {
app.GrpcStreamingManager.Stop()
}
return nil
},
)
Expand Down
1 change: 0 additions & 1 deletion protocol/streaming/grpc/grpc_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func NewGrpcStreamingManager(
for {
select {
case <-grpcStreamingManager.ticker.C:
// fix this with values
grpcStreamingManager.FlushStreamUpdates()
case <-grpcStreamingManager.done:
return
Expand Down
3 changes: 3 additions & 0 deletions protocol/streaming/grpc/noop_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ func (sm *NoopGrpcStreamingManager) SendOrderbookFillUpdates(
func (sm *NoopGrpcStreamingManager) GetUninitializedClobPairIds() []uint32 {
return []uint32{}
}

func (sm *NoopGrpcStreamingManager) Stop() {
}
2 changes: 1 addition & 1 deletion protocol/streaming/grpc/types/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type GrpcStreamingManager interface {
Enabled() bool

Stop()
// L3+ Orderbook updates.
Subscribe(
req clobtypes.StreamOrderbookUpdatesRequest,
Expand Down

0 comments on commit edb122c

Please sign in to comment.