Suddenly Slowness with Python SDK


We’ve been using the Python SDK to run a nightly job that gives us a list of all the files (and some metadata) in our account.

That job historically took about 30 minutes to complete, recursively going through all the directories, etc. As of a few days ago (11/5), though, it suddenly doubled in length, even though the number of files/folders in our account hadn’t changed.

So two questions:

  1. Has anyone else noticed anything similar over the last few days?
  2. Is there a better/different way to get to that data?

Our current function looks something like this:

def get_recursive_files(settings, client, folder_id, path_prefix=None):
    file_list = []
    folder = client.folder(folder_id).get()
    for item in folder.get_items():
        if item.type == 'folder':
            file_list += get_recursive_files(settings, client,, path_prefix)
            file = item.get(fields=['id', 'name', 'created_by', 'created_at', 'modified_by', 'modified_at', 'path_collection', 'version_number'])
            file_path = '/'.join([ for e in file.path_collection['entries']])

            if path_prefix is not None:
                if file_path.startswith(path_prefix):
                    file_path = file_path[len(path_prefix):]

                if file_path.startswith('/'):
                    file_path = file_path[1:]

            created_by = f'{} <{file.created_by.login}>' if != "Anonymous User" else f'{}'
            modified_by = f'{} <{file.modified_by.login}>' if != "Anonymous User" else f'{}'

            f_dict = {
                'created_by': created_by,
                'created_at': file.created_at, 
                'modified_by': modified_by,
                'modified_at': file.modified_at, 
                'file_path': file_path,
                'url': f'/file/{}',
                'version_number': file.version_number,
                'folder_id': folder_id

    return file_list

Hi Justin (@user120), welcome to the forum.

This is interesting.

Last week there were a few issues reported with Box.

I’m wondering if this situation is consistent, let us know if so, one way or the other.

In the mean time, I’ll convert this into a support case, so the IT folks can follow up with you.

Best regards