Getting 502 error on the Smush page

I have 80 000 images on my site, and when I open Smush page in WordPress dashboard, I’m getting 502 error. Previously, you’ve provided me with a hotfix fo this issue here:

But the plugin’s structure and code has been changed, so it’s not relevant anymore. Could you provide me with a fix that is relevant for the latest Smush Pro version.