Skip to content

Commit 6cb1b21

Browse files
committed
Fix wrong position of warm up call in resharing
1 parent 0f104b9 commit 6cb1b21

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pkg/eventconsumer/event_consumer.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,11 @@ func (ec *eventConsumer) consumeReshareEvent() error {
638638

639639
var wg sync.WaitGroup
640640
ctx := context.Background()
641-
642-
ec.warmUpSession()
643-
644641
if oldSession != nil {
645642
ctxOld, doneOld := context.WithCancel(ctx)
646643
oldSession.Init()
647644
oldSession.ListenToIncomingMessageAsync()
645+
ec.warmUpSession()
648646
go oldSession.Reshare(doneOld)
649647

650648
wg.Add(1)
@@ -668,6 +666,7 @@ func (ec *eventConsumer) consumeReshareEvent() error {
668666
ctxNew, doneNew := context.WithCancel(ctx)
669667
newSession.Init()
670668
newSession.ListenToIncomingMessageAsync()
669+
ec.warmUpSession()
671670
go newSession.Reshare(doneNew)
672671

673672
wg.Add(1)
@@ -689,7 +688,6 @@ func (ec *eventConsumer) consumeReshareEvent() error {
689688
}
690689

691690
wg.Wait()
692-
693691
logger.Info("Reshare session finished", "walletID", walletID, "pubKey", fmt.Sprintf("%x", successEvent.PubKey))
694692

695693
if newSession != nil {

0 commit comments

Comments
 (0)