mirror of
https://github.com/openwrt/luci.git
synced 2026-04-15 19:01:56 +00:00
luci-base: prevent save/traceback race for _state
A _state race is possible during save when a refresh is in progress. Attempt to avoid it by not nulling state prior to refresh. Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
@@ -354,7 +354,6 @@ function initNetworkState(refresh) {
|
||||
if (_state == null || refresh) {
|
||||
const hasWifi = L.hasSystemFeature('wifi');
|
||||
|
||||
if (refresh) _state = null;
|
||||
if (refresh || !_init) {
|
||||
_init = Promise.all([
|
||||
L.resolveDefault(callNetworkInterfaceDump(), []),
|
||||
@@ -538,6 +537,9 @@ function initNetworkState(refresh) {
|
||||
|
||||
}
|
||||
|
||||
if (refresh)
|
||||
return _init;
|
||||
|
||||
return (_state != null ? Promise.resolve(_state) : _init);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user