time.Hour * 24 * 7
This commit is contained in:
parent
f37bcd9878
commit
ac33837a78
|
@ -112,9 +112,14 @@ func (s *Minio) Url(objectName string, expire time.Duration) string {
|
||||||
if err := s.Init(); err != nil {
|
if err := s.Init(); err != nil {
|
||||||
return err.Error()
|
return err.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if expire > time.Hour*24*7 {
|
||||||
|
expire = time.Hour * 24 * 7
|
||||||
|
}
|
||||||
var params url.Values
|
var params url.Values
|
||||||
u, err := s.client.PresignedGetObject(s.config.Bucket, objectName, expire, params)
|
u, err := s.client.PresignedGetObject(s.config.Bucket, objectName, expire, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Errorf("error:%s", err.Error())
|
||||||
return fmt.Sprintf("%s/%s/%s", s.config.BaseUrl, s.config.Bucket, objectName)
|
return fmt.Sprintf("%s/%s/%s", s.config.BaseUrl, s.config.Bucket, objectName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue