Skip to content

Commit

Permalink
fix(doge): reget client after refresh session (AlistGo#6277)
Browse files Browse the repository at this point in the history
  • Loading branch information
eryajf authored Mar 29, 2024
1 parent e37465e commit 0e86036
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 0e86036

Please sign in to comment.