mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 03:35:32 -05:00
This commit handles an issue some customers are having with the media optimization worker when uploading images. 1. Sometimes the `new Worker()` call hangs indefinitely. To handle this, we can check if it installed within 3 seconds, and if not we fail and reject the promise. 2. We also add a `try...catch` around the `new Worker()` call to catch any CSP issues or exceptions that may occur during worker instantiation.