fix problem with proxy for Telegram
This PR fixes problem with proxy for Telegram
This commit is contained in:
@@ -140,10 +140,14 @@ class TelegramChannel(BaseChannel):
|
|||||||
self._running = True
|
self._running = True
|
||||||
|
|
||||||
# Build the application with larger connection pool to avoid pool-timeout on long runs
|
# Build the application with larger connection pool to avoid pool-timeout on long runs
|
||||||
req = HTTPXRequest(connection_pool_size=16, pool_timeout=5.0, connect_timeout=30.0, read_timeout=30.0)
|
req = HTTPXRequest(
|
||||||
|
connection_pool_size=16,
|
||||||
|
pool_timeout=5.0,
|
||||||
|
connect_timeout=30.0,
|
||||||
|
read_timeout=30.0,
|
||||||
|
proxy=self.config.proxy if self.config.proxy else None
|
||||||
|
)
|
||||||
builder = Application.builder().token(self.config.token).request(req).get_updates_request(req)
|
builder = Application.builder().token(self.config.token).request(req).get_updates_request(req)
|
||||||
if self.config.proxy:
|
|
||||||
builder = builder.proxy(self.config.proxy).get_updates_proxy(self.config.proxy)
|
|
||||||
self._app = builder.build()
|
self._app = builder.build()
|
||||||
self._app.add_error_handler(self._on_error)
|
self._app.add_error_handler(self._on_error)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user