I need suggestions on how to deal with timeouts when making a rest call
As stated in another post, I played around with 'making something that can take screenshots of a Plone site.
Using sanic and asyncio I have made a asyncio (rest) app so
http://someip/sitemap/http://myplonesite.xml.gz takes screenshots of 'everything' in the sitemap
Returns a screenshot of any page.
Now: I want to add a browser view in Plone, so it is possible to
http://myplonesite/somefolder/@@makescreenshots would make screenshots of all pages 'inside some folder'.
Since this might take several minutes: how do I deal with timeouts.
Is it possible
- from Plone, call http://sanic_app/makescreenshots
- from sanic_app: return a code (202 ? ) and a message 'work in progress' and a link or something
- in sanic app: make the screenshots and send message
PS: Help with what I can google is also helpful
Update: I have put very basic working code here: https://github.com/espenmn/medialog.takescreenshhot/blob/8ecc7e25adf19317aa4d48ea3136de7cd0cd616e/make_screenshot_app.py