Skip to content

Commit

Permalink
Revert "fix(telegram): reset backoff until reconnectUntilClosed"
Browse files Browse the repository at this point in the history
This reverts commit 951db34.
  • Loading branch information
ernado committed Oct 9, 2024
1 parent 074796d commit 242bf87
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions telegram/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@ func (c *Client) reconnectUntilClosed(ctx context.Context) error {
b := tdsync.SyncBackoff(backoff.WithContext(c.connBackoff(), ctx))
g := tdsync.NewCancellableGroup(ctx)
g.Go(func(ctx context.Context) error {
for {
select {
case <-ctx.Done():
return ctx.Err()
case <-c.ready.Ready():
// Reset backoff on successful connection.
b.Reset()
}
select {
case <-ctx.Done():
return ctx.Err()
case <-c.ready.Ready():
// Reset backoff on successful connection.
b.Reset()
return nil
}
})
g.Go(func(ctx context.Context) error {
Expand Down

0 comments on commit 242bf87

Please sign in to comment.