Feature/study application memory #70

Open
abdulrabbani00 wants to merge 18 commits from feature/study-application-memory into develop
3 changed files with 3 additions and 4 deletions
Showing only changes of commit 32ec784e1e - Show all commits

View File

@ -39,6 +39,8 @@ func (bc *BeaconClient) StopHeadTracking(ctx context.Context, skipSee bool) {
bc.HeadTracking.SseClient.Unsubscribe(bc.HeadTracking.MessagesCh) bc.HeadTracking.SseClient.Unsubscribe(bc.HeadTracking.MessagesCh)
bc.ReOrgTracking.SseClient.Unsubscribe(bc.ReOrgTracking.MessagesCh) bc.ReOrgTracking.SseClient.Unsubscribe(bc.ReOrgTracking.MessagesCh)
log.Info("Successfully unsubscribed to SSE client") log.Info("Successfully unsubscribed to SSE client")
close(bc.ReOrgTracking.MessagesCh)
close(bc.HeadTracking.MessagesCh)
} }
log.Info("Successfully stopped the head tracking service.") log.Info("Successfully stopped the head tracking service.")
default: default:

View File

@ -47,8 +47,7 @@ func handleIncomingSseEvent[P ProcessedEvents](ctx context.Context, eventHandler
for { for {
select { select {
case <-ctx.Done(): case <-ctx.Done():
close(eventHandler.MessagesCh) close(eventHandler.ProcessCh)
close(eventHandler.ErrorCh)
return return
case message := <-eventHandler.MessagesCh: case message := <-eventHandler.MessagesCh:
// Message can be nil if its a keep-alive message // Message can be nil if its a keep-alive message

View File

@ -33,7 +33,6 @@ func (bc *BeaconClient) handleReorg(ctx context.Context) {
for { for {
select { select {
case <-ctx.Done(): case <-ctx.Done():
close(bc.ReOrgTracking.ProcessCh)
return return
case reorg := <-bc.ReOrgTracking.ProcessCh: case reorg := <-bc.ReOrgTracking.ProcessCh:
log.WithFields(log.Fields{"reorg": reorg}).Debug("Received a new reorg message.") log.WithFields(log.Fields{"reorg": reorg}).Debug("Received a new reorg message.")
@ -55,7 +54,6 @@ func (bc *BeaconClient) handleHead(ctx context.Context, maxWorkers int) {
for { for {
select { select {
case <-ctx.Done(): case <-ctx.Done():
close(bc.HeadTracking.ProcessCh)
close(workCh) close(workCh)
return return
case head := <-bc.HeadTracking.ProcessCh: case head := <-bc.HeadTracking.ProcessCh: