[Question] Long running http call in Update not Logging

I am developing an agent and in my update function I have a HTTP Post to Cloudinary. However it never succeeds and I cannot seem to get anything to log. Here is the pseudo-code:

I have already tested this on system-wide python and it works fine. I have tested to ensure cloudinary library loads correctly with Plex and it does, and lastly I have credentials as a system-wide environment variable.

Edit: I am looking into the possibility that the environment variable is not being read by Plex’s embedded python.

Any help is appreciated

try:
    file, ext = os.path.splitext(url)
     # any log statements above this execute
    cloudinary.uploader.upload(url, public_id=jID,
                                    width = src_width/2,
                                    height = src_height,
                                    x = src_width/2,
                                    y = 0,
                                    crop='crop',
                                    tags=['jl'])

    Log('Requesting cloudinary id for ' + str(jID+ext))  # does not Log
    ret = cloudinary.utils.cloudinary_url(jID+'.'+ext,
                                    width = src_width/2,
                                    height = src_height,
                                    x = src_width/2,
                                    y = 0,
                                    crop='crop',
                                    tags=['jl'])
    Log('Request is finished' + str(ret)) # does not Log
    return ret
  except e:
    Log.Exception(e)  # does not Log
  return url

def update(...):
   # Get image
   resize_image(...)
   # update metadata url (all log statements from here on execute)