You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running Django Migrations I noticed that pyuploadcare's FileField makes a network request because an http transport is instantiated. It all runs fine when I run it outside of migrations but when I run it in migrations httpx gets stuck here:
File "C:\Users\micah\Envs\ad\Lib\site-packages\pyuploadcare\dj\models.py", line 128, in __init__
super(ImageField, self).__init__(*args, **kwargs)
File "C:\Users\micah\Envs\ad\Lib\site-packages\pyuploadcare\dj\models.py", line 25, in __init__
self._client = get_uploadcare_client()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\pyuploadcare\dj\client.py", line 18, in get_uploadcare_client
return Uploadcare(**config)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\pyuploadcare\client.py", line 130, in __init__
self.upload_client = Client(
^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\pyuploadcare\api\client.py", line 46, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\micah\Envs\ad\Lib\site-packages\httpx\_client.py", line 679, in __init__
self._transport = self._init_transport(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\httpx\_client.py", line 727, in _init_transport
return HTTPTransport(
^^^^^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\httpx\_transports\default.py", line 126, in __init__
ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\httpx\_config.py", line 51, in create_ssl_context
return SSLConfig(
^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\httpx\_config.py", line 75, in __init__
self.ssl_context = self.load_ssl_context()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\httpx\_config.py", line 87, in load_ssl_context
return self.load_ssl_context_verify()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\micah\Envs\ad\Lib\site-packages\httpx\_config.py", line 145, in load_ssl_context_verify
context.load_verify_locations(cafile=str(ca_bundle_path))
This might be due to a large Insert number of migrations, which can definitely be fixed on my end. however these other issues seem to indicate that caching the SSL context can speed up things dramatically especially if you're instantiating a variable number of clients. On the particular project this is happening on, I have a lot of File fields that are being used and referenced in a lot of migrations so Things seem to be slowed down a lot.
Describe the bug
When running Django Migrations I noticed that
pyuploadcare
'sFileField
makes a network request because an http transport is instantiated. It all runs fine when I run it outside of migrations but when I run it in migrations httpx gets stuck here:This might be due to a large Insert number of migrations, which can definitely be fixed on my end. however these other issues seem to indicate that caching the SSL context can speed up things dramatically especially if you're instantiating a variable number of clients. On the particular project this is happening on, I have a lot of File fields that are being used and referenced in a lot of migrations so Things seem to be slowed down a lot.
encode/httpx#838 (comment)
encode/httpx#838 (comment)
The text was updated successfully, but these errors were encountered: