luci-base: set the fallback default of rollback timeout to 90s
authorHannu Nyman <hannu.nyman@iki.fi>
Mon, 26 Oct 2020 20:26:08 +0000 (22:26 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Mon, 26 Oct 2020 20:26:08 +0000 (22:26 +0200)
Set the fallback value of the config change rollback timeout
to 90 seconds to match the change in /etc/config/luci by commit
81cf99a50.

That commit changed the value in the config file, but did
not change the underlying fallback values that do get applied
when there is no proper config item in etc/config/luci.

Users sysupgrading from old systems may have carried an ancient
/etc/config/luci (without rollback config) with them, so this
change should help them to see the intended user experience.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit b0fe11ffc4921c606b78ceb9756cc44579689005)

modules/luci-base/luasrc/model/uci.lua
modules/luci-base/luasrc/view/header.htm

index a50e28a871c1351aecb5c7407571954a7305eb94..816f6f20538adeb9ee6bde0f3861200358e5664e 100644 (file)
@@ -123,10 +123,10 @@ function apply(self, rollback)
        if rollback then
                local sys = require "luci.sys"
                local conf = require "luci.config"
-               local timeout = tonumber(conf and conf.apply and conf.apply.rollback or 30) or 0
+               local timeout = tonumber(conf and conf.apply and conf.apply.rollback or 90) or 0
 
                _, err = call("apply", {
-                       timeout = (timeout > 30) and timeout or 30,
+                       timeout = (timeout > 90) and timeout or 90,
                        rollback = true
                })
 
index e7b2d4787bfccb6c4ee06131a5ce64700e853a7a..cffe9482cadca2c99ab25a47f1551993e5bb8a14 100644 (file)
@@ -29,7 +29,7 @@
                ubuspath       = luci.config.main.ubuspath or '/ubus/',
                sessionid      = luci.dispatcher.context.authsession,
                nodespec       = luci.dispatcher.context.dispatched,
-               apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30),
+               apply_rollback = math.max(applyconf and applyconf.rollback or 90, 90),
                apply_holdoff  = math.max(applyconf and applyconf.holdoff or 4, 1),
                apply_timeout  = math.max(applyconf and applyconf.timeout or 5, 1),
                apply_display  = math.max(applyconf and applyconf.display or 1.5, 1),