diff options
Diffstat (limited to 'weed/server/volume_grpc_erasure_coding.go')
| -rw-r--r-- | weed/server/volume_grpc_erasure_coding.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go index fe12b3a22..642e8cce3 100644 --- a/weed/server/volume_grpc_erasure_coding.go +++ b/weed/server/volume_grpc_erasure_coding.go @@ -72,19 +72,16 @@ func (vs *VolumeServer) VolumeEcShardsGenerate(ctx context.Context, req *volume_ } // write .vif files - var destroyTime uint64 + var expireAtSec uint64 if v.Ttl != nil { - ttlMills := v.Ttl.ToSeconds() - if ttlMills > 0 { - destroyTime = uint64(time.Now().Unix()) + v.Ttl.ToSeconds() //calculated destroy time from the ec volume was created + ttlSecond := v.Ttl.ToSeconds() + if ttlSecond > 0 { + expireAtSec = uint64(time.Now().Unix()) + ttlSecond //calculated expiration time } } volumeInfo := &volume_server_pb.VolumeInfo{Version: uint32(v.Version())} - if destroyTime == 0 { - glog.Warningf("gen ec volume,cal ec volume destory time fail,set time to 0,ttl:%v", v.Ttl) - } else { - volumeInfo.DestroyTime = destroyTime - } + volumeInfo.ExpireAtSec = expireAtSec + datSize, _, _ := v.FileStat() volumeInfo.DatFileSize = int64(datSize) if err := volume_info.SaveVolumeInfo(baseFileName+".vif", volumeInfo); err != nil { |
