mirror of
https://github.com/rclone/rclone.git
synced 2025-01-08 23:40:29 +01:00
link: use "off" value for unset expiry
This commit is contained in:
parent
3d3ff61f74
commit
9393225a1d
@ -1429,7 +1429,7 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration,
|
|||||||
Password: f.opt.LinkPassword,
|
Password: f.opt.LinkPassword,
|
||||||
}
|
}
|
||||||
|
|
||||||
if expire < fs.Duration(time.Hour*24*365*100) {
|
if expire < fs.DurationOff {
|
||||||
expiry := time.Now().Add(time.Duration(expire))
|
expiry := time.Now().Add(time.Duration(expire))
|
||||||
share.Expiry = &expiry
|
share.Expiry = &expiry
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package link
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/rclone/rclone/cmd"
|
"github.com/rclone/rclone/cmd"
|
||||||
"github.com/rclone/rclone/fs"
|
"github.com/rclone/rclone/fs"
|
||||||
@ -13,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
expire = fs.Duration(time.Hour * 24 * 365 * 100)
|
expire = fs.DurationOff
|
||||||
unlink = false
|
unlink = false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user