diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index cb1e52df..d61e37d6 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -157,7 +157,7 @@ class Client: self.proxy, self.auth_key, self.config.api_id, - workers=self.workers + net_workers=self.workers ) terms = self.session.start() @@ -263,7 +263,7 @@ class Client: self.proxy, self.auth_key, self.config.api_id, - workers=self.workers + net_workers=self.workers ) self.session.start() diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index b117a3fc..ffd768e5 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -75,14 +75,14 @@ class Session: auth_key: bytes, api_id: str, is_cdn: bool = False, - workers: int = 2): + net_workers: int = 2): if not Session.notice_displayed: print("Pyrogram v{}, {}".format(__version__, __copyright__)) print("Licensed under the terms of the " + __license__, end="\n\n") Session.notice_displayed = True self.is_cdn = is_cdn - self.workers = workers + self.net_workers = net_workers self.connection = Connection(DataCenter(dc_id, test_mode), proxy) @@ -124,8 +124,8 @@ class Session: try: self.connection.connect() - for i in range(self.workers): - Thread(target=self.worker, name="Worker#{}".format(i + 1)).start() + for i in range(self.net_workers): + Thread(target=self.net_worker, name="NetWorker#{}".format(i + 1)).start() Thread(target=self.recv, name="RecvThread").start() @@ -184,7 +184,7 @@ class Session: self.connection.close() - for i in range(self.workers): + for i in range(self.net_workers): self.recv_queue.put(None) log.debug("Session stopped") @@ -232,7 +232,7 @@ class Session: return message - def worker(self): + def net_worker(self): name = threading.current_thread().name log.debug("{} started".format(name))