Browse Source

filer: detect ttl based on fs configure setting

pull/3143/head
chrislu 3 years ago
parent
commit
8402af0882
  1. 7
      weed/server/filer_grpc_server.go

7
weed/server/filer_grpc_server.go

@ -144,8 +144,15 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntr
return &filer_pb.CreateEntryResponse{}, fmt.Errorf("CreateEntry cleanupChunks %s %s: %v", req.Directory, req.Entry.Name, err2)
}
so, err := fs.detectStorageOption(string(util.NewFullPath(req.Directory, req.Entry.Name)), "", "", 0, "", "", "", "")
if err != nil {
return nil, err
}
newEntry := filer.FromPbEntry(req.Directory, req.Entry)
newEntry.Chunks = chunks
newEntry.TtlSec = so.TtlSeconds
newEntry.Collection = so.Collection
newEntry.DiskType = so.DiskType
createErr := fs.filer.CreateEntry(ctx, newEntry, req.OExcl, req.IsFromOtherCluster, req.Signatures, req.SkipCheckParentDirectory)

Loading…
Cancel
Save