3 ms·
I built an importer script once -- the importing itself was handled in a worker, so when the file was first submitted, the importing would be done on a separate
by mmanfrin 13y ago
I built an importer script once -- the importing itself was handled in a worker, so when the file was first submitted, the importing would be done on a separate thread in a Transaction -- pretty much making it impossible to actually track progress. I set it so that it would 'tick' up a couple % every Math.rand(0..2) seconds; but also poll for the statuses I did know about (accepted, queued, started, finished).
It honestly made for a very comfortable UX -- customers did not know it was not actually representative of the true status, but they were nevertheless okay with waiting the 30~ seconds it took.