update renew interval
This commit is contained in:
parent
273878d039
commit
5afc25d596
2
auth.go
2
auth.go
@ -113,5 +113,5 @@ func updateToken() {
|
||||
}
|
||||
// Append access token to access_tokens.json
|
||||
ACCESS_TOKENS = tokens.NewAccessToken(token_list, true)
|
||||
time.AfterFunc(2.16e15, updateToken)
|
||||
time.AfterFunc(1.728e15, updateToken)
|
||||
}
|
||||
|
4
main.go
4
main.go
@ -60,8 +60,8 @@ func init() {
|
||||
} else {
|
||||
nowTime := time.Now()
|
||||
usedTime := nowTime.Sub(stat.ModTime())
|
||||
// update access token 25 days after last modify token file
|
||||
toExpire := 2.16e15 - usedTime
|
||||
// update access token 20 days after last modify token file
|
||||
toExpire := 1.728e15 - usedTime
|
||||
if toExpire > 0 {
|
||||
file, err := os.Open("access_tokens.json")
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user