BigKuLaK / ifind_scripts

0 stars 0 forks source link

Improve prerendering logs fetching #11

Closed qtgye closed 1 year ago

qtgye commented 1 year ago

Goal

To be able to to provide a realtime logging during the prerender process. That is, when the script server triggers the prerender on the main server, it should be able to receive logs incrementally, while the prerenderer is still running. This allows the logs to saved onto the script server itself in a realtime manner. This is achievable by leveraging ReadableStreams from the fetch's Response.body.

Tasks

Main Server

Script Server

qtgye commented 1 year ago

Findings

While streaming works fine on using setInterval (Script Server able to receive logs one by one), it doesn't work on the actual Prerender process. MIght have something to do with each log's interval, which in prerenderer its almost always instant.

Dropping this implementation, and having the Scripts Server wait for the success response instead.