Resolve "Slow UPnP startup"
MERGE REQUEST
Changes to Work Flow
The gateway will try and call upnp.Load()
first before upnp.Discover()
in an attempt to have a faster startup. The IP address will be persisted in the gateway. The original issue mentioned that host also calls upnp.Discover()
since the host and gateway couldn't communicate. Since then it appears the gateway has been added as a dependency of the host and therefore does not need to call upnp.Discover()
itself but relies on the gateway.
For the gateway persistence nodes.json
was left alone and gateway.json
was created. myAddr
was moved to the persistence struct for the gateway and persisted. The persisted nodes and the gateway persistence are loaded and saved in separate methods.
Testing Updates
- Expand
TestLoad
persistence test for the gateway to check for gateway persistence as well as persisted nodes -
Tries to test on live network to confirm faster start up and that data is persisted. Confirmed that persistence worked but I did not have access to an UPnP enabled router to verify the UPnP code.
Modules and Packages Impacted
- gateway - upnp and persistence
Closes #2300 (closed)