Fix background thread could not reconnect properly

This commit is contained in:
Lonami Exo
2017-09-22 12:44:09 +02:00
parent 4245ec5abc
commit 4d5f16f2aa
2 changed files with 9 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ from datetime import timedelta
from hashlib import md5
from io import BytesIO
from os import path
from threading import RLock
from threading import Lock
from . import helpers as utils
from .crypto import rsa, CdnDecrypter
@@ -84,7 +84,7 @@ class TelegramBareClient:
# Two threads may be calling reconnect() when the connection is lost,
# we only want one to actually perform the reconnection.
self._connect_lock = RLock()
self._connect_lock = Lock()
# Cache "exported" senders 'dc_id: TelegramBareClient' and
# their corresponding sessions not to recreate them all