mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-24 08:46:54 +08:00
EC volume supports expiration and displays expiration message when executing volume.list (#5895)
* ec volume expire * volume.list show DestroyTime * comments * code optimization --------- Co-authored-by: xuwenfeng <xuwenfeng1@zto.com>
This commit is contained in:
@@ -103,6 +103,26 @@ func (t *TTL) String() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (t *TTL) ToSeconds() uint64 {
|
||||
switch t.Unit {
|
||||
case Empty:
|
||||
return 0
|
||||
case Minute:
|
||||
return uint64(t.Count) * 60
|
||||
case Hour:
|
||||
return uint64(t.Count) * 60 * 60
|
||||
case Day:
|
||||
return uint64(t.Count) * 60 * 24 * 60
|
||||
case Week:
|
||||
return uint64(t.Count) * 60 * 24 * 7 * 60
|
||||
case Month:
|
||||
return uint64(t.Count) * 60 * 24 * 30 * 60
|
||||
case Year:
|
||||
return uint64(t.Count) * 60 * 24 * 365 * 60
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func toStoredByte(readableUnitByte byte) byte {
|
||||
switch readableUnitByte {
|
||||
case 'm':
|
||||
|
||||
Reference in New Issue
Block a user