Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Doge 重置秘钥之后未重新获取客户端导致403 #6277

Merged
merged 11 commits into from
Mar 29, 2024
3 changes: 3 additions & 0 deletions drivers/s3/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading