fix(doge): reget client after refresh session (#6277)

pull/6283/head
二丫讲梵 2024-03-29 14:56:49 +08:00 committed by GitHub
parent e37465e67e
commit 0e86036874
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -45,12 +45,15 @@ func (d *S3) Init(ctx context.Context) error {
d.Region = "alist"
}
if d.config.Name == "Doge" {
// 多吉云每次临时生成的秘钥有效期为 2h所以这里设置为 118 分钟重新生成一次
d.cron = cron.NewCron(time.Minute * 118)
d.cron.Do(func() {
err := d.initSession()
if err != nil {
log.Errorln("Doge init session error:", err)
}
d.client = d.getClient(false)
d.linkClient = d.getClient(true)
})
}
err := d.initSession()