1
0

shorten cycle

This commit is contained in:
root 2023-07-17 10:57:17 +08:00
parent 4813ac39e3
commit baf8da9268

View File

@ -56,8 +56,8 @@ func scheduleToken() {
} else {
nowTime := time.Now()
usedTime := nowTime.Sub(stat.ModTime())
// update access token 20 days after last modify token file
toExpire := 1.728e15 - usedTime
// update access token 14 days after last modify token file
toExpire := 1.2096e15 - usedTime
if toExpire > 0 {
file, err := os.Open("access_tokens.json")
if err != nil {
@ -147,5 +147,5 @@ func updateToken() {
}
// Append access token to access_tokens.json
ACCESS_TOKENS = tokens.NewAccessToken(token_list, true)
time.AfterFunc(1.728e15, updateToken)
time.AfterFunc(1.2096e15, updateToken)
}