From 9d6dfd0d0a9084f93ba5f6e33ca3e0d5ee64a1e5 Mon Sep 17 00:00:00 2001 From: tickstep Date: Sat, 2 Mar 2024 19:11:58 +0800 Subject: [PATCH] short web token refresh time interval --- internal/command/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/command/utils.go b/internal/command/utils.go index 589fa50..4aca16e 100644 --- a/internal/command/utils.go +++ b/internal/command/utils.go @@ -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{