Move SQLite generation to a worker job
This is related to #531
Basically, for a large corpus, when you try to download SQLite, generation of it takes so long that the user experiences a 504 (Gateway Time-out), i.e. nginx breaking the connection because the backend takes too long to respond.
We should move SQLite generation to be a separate worker job. After it's done, an email should be sent to the user with some unique link where he can download the file. This file should be cleaned up, say, after 1 day or after user download, to prevent bloat accumulating.
Please note that the same thing can eventually happen with all our downloads. It's just a matter of corpus size.
Another solution, avoiding emails, is a "loader" circle after user requests download. The dialog stays open and user has to wait for the short-lived download link to appear while the background job is running.
A fancy option also would be to close the download dialog, let the user do his work, in the meantime show progress bar for download generation, and when the work is done, infom the user via our websocket notification mechanism -- the one at the top which displays warnings, errors, etc. We can send email at the same time just to make sure we reach offline users.