Open greenscientist opened 6 months ago
This was done to make sure that the cache was always present when the application is available, so we don't have to manage if it's there or not, because the next block makes enqueues previously running tasks and when they run, the cache has better be there.
I don't like the idea of needing an extra mechanism to make sure calculations are ready and having to wait for it. But if it can be done cleanly and be transparent to calculation tasks, then I guess I can be convinced.
The biggest issue in the code path is recalculating all the transferable nodes. Maybe that could be skipped now, isn't everything in the DB ?
Also something seems off with the promise in the code path. We should be able to send more calculation to OSRM in parallel, it's just IO. Probablement we have an extra await somewhere.
The following code is in the startup path:
It should be done in the background, while still letting the user come in. We should not start any calculation before this is done, but users should be able to use the interface.