SABS-R3-Epidemiology / branchpro

Using branching processes to estimate the time-dependent reproduction number of a disease with imported cases
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Deal with slow callbacks on deployed inference app #205

Closed rccreswell closed 2 years ago

rccreswell commented 2 years ago

Web servers don't like any callback which takes more than a few seconds to return, and a callback which runs for about 20 seconds or longer may cause the app to crash. When 1000 serial interval samples (as in the paper) are uploaded to the inference app, the runtime for update_posterior_figure is around 90--120 seconds, which is not allowed by heroku or even google cloud.

A few weeks ago dash added support for long callbacks. This is probably the easiest way to fix the problem without having to fiddle with processes or intervals ourselves.