mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-02-02 21:27:15 +08:00
short web token refresh time interval
This commit is contained in:
parent
3c0da7fc1d
commit
9d6dfd0d0a
@ -152,7 +152,7 @@ func RefreshTokenInNeed(activeUser *config.PanUser, deviceName string) bool {
|
|||||||
cz := time.FixedZone("CST", 8*3600) // 东8区
|
cz := time.FixedZone("CST", 8*3600) // 东8区
|
||||||
expiredTime := time.Unix(activeUser.WebapiToken.Expired, 0).In(cz)
|
expiredTime := time.Unix(activeUser.WebapiToken.Expired, 0).In(cz)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
if (expiredTime.Unix() - now.Unix()) <= (5 * 60) { // 有效期小于5min就刷新
|
if (expiredTime.Unix() - now.Unix()) <= (2 * 60) { // 有效期小于2min就刷新
|
||||||
pluginManger := plugins.NewPluginManager(config.GetPluginDir())
|
pluginManger := plugins.NewPluginManager(config.GetPluginDir())
|
||||||
plugin, _ := pluginManger.GetPlugin()
|
plugin, _ := pluginManger.GetPlugin()
|
||||||
params := &plugins.UserTokenRefreshFinishParams{
|
params := &plugins.UserTokenRefreshFinishParams{
|
||||||
|
Loading…
Reference in New Issue
Block a user