short web token refresh time interval

This commit is contained in:
tickstep 2024-03-02 19:11:58 +08:00
parent 3c0da7fc1d
commit 9d6dfd0d0a

View File

@ -152,7 +152,7 @@ func RefreshTokenInNeed(activeUser *config.PanUser, deviceName string) bool {
cz := time.FixedZone("CST", 8*3600) // 东8区
expiredTime := time.Unix(activeUser.WebapiToken.Expired, 0).In(cz)
now := time.Now()
if (expiredTime.Unix() - now.Unix()) <= (5 * 60) { // 有效期小于5min就刷新
if (expiredTime.Unix() - now.Unix()) <= (2 * 60) { // 有效期小于2min就刷新
pluginManger := plugins.NewPluginManager(config.GetPluginDir())
plugin, _ := pluginManger.GetPlugin()
params := &plugins.UserTokenRefreshFinishParams{