aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-05-14 01:32:11 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-05-14 01:32:11 +0300
commit25e8c98c3ea2e9249416e70cea6c9818757ddff2 (patch)
tree54a33f8447e0dc551cffc68d8f3d452a9fe734f3
parentb3edc455262b0443ac2baddba96cc2d7e350ef13 (diff)
Release the authorization lock on client initialization error
-rw-r--r--telegram/connect.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/telegram/connect.go b/telegram/connect.go
index a4dfa37..37f719e 100644
--- a/telegram/connect.go
+++ b/telegram/connect.go
@@ -112,6 +112,7 @@ func (c *Client) Connect(resource string) error {
tdlibClient, err := client.NewClient(c.authorizer, c.options...)
if err != nil {
+ c.locks.authorizationReady.Done()
return errors.Wrap(err, "Couldn't initialize a Telegram client instance")
}