mozilla / webcompat-dashboard

Web Compatibility Knowledge Base Next Generation Dashboard
Mozilla Public License 2.0
2 stars 2 forks source link

Share /user_reports Worker to avoid startup overhead #22

Closed moztcampbell closed 6 months ago

moztcampbell commented 6 months ago

Reuse the Worker between requests. This adds a listener for a "fetch" message in order to start the BQ fetch and data transform. I create a new MessageChannel for each request to make it simple for notifying the correct Promise when the work is done. This should save a few seconds off each of the requests that was blocked by startup overhead.