Closed greenscientist closed 2 months ago
This save 5 minutes on startup on my machine. (on a total that was about 7 minutes)
Please run yarn format
to get the linter to pass
Also, isn't there an issue related to this PR? If so, please add to the commit message.
Also, isn't there an issue related to this PR? If so, please add to the commit message.
It did not add it because it did not want for github to close the issue. It's not fully solving it (#898)
Set to draft. Something in my test, we are missing some data in the cache files.
Added the ugly quick fix
Le test fail, mais c'est. Ça fonctionne avec trRouting?
I know... I don't know why the test for the previous function have functionned at all :(
Mais oui, ca fonctionne avec trRouting.
Yeah, no I really don't want to add more test for that. I don't see any way to do a clean test for that. It should all go away anyway with a good refactor. This data structure really upset me with the way it is at the moment!
What upsets you so much? Transferable nodes are a concept outside the node itself, they should not be inside the node. Is it because it is an optional property of the node's data field that bugs you most?
What upsets you so much? Transferable nodes are a concept outside the node itself, they should not be inside the node. Is it because it is an optional property of the node's data field that bugs you most?
You say it's separate, by everywhere in our applications, it's contained inside the Node (in TrRouting, Transition, in the capnp cache). If it's a separate thing, it should be it's own object, not part of a Node one.
We now save the transferable nodes in the database, so we don't really need to recalculate them at each startup. But we still need to save them to the capnp cache file.
We add a saveAllNodesToCache function to NodeCollectionUtils, based on saveAndUpdateAllNodes, that only store the node data without recalculating it. We add a else in the recreateCache function where we test for the refreshTransferrableNodes flag to call our new function in that case. (That way we always save the transferable nodes to cache)
The dbToCache were missing a mockClear, we switch it to jest.clearAllMocks() and fixes the erroneous tests
The call in socketServerApp was changed to ask for not refreshing the transferable node when recreating the cache on startup