ensure metadata follow a specific folder

fix https://github.com/seaweedfs/seaweedfs/issues/5774
This commit is contained in:
chrislu
2024-07-12 11:17:28 -07:00
parent ec9e7493b3
commit 3a82f5ffad
7 changed files with 40 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"strconv"
"strings"
"time"
)
@@ -79,12 +80,17 @@ func startGenerateMetadata() {
func startSubscribeMetadata(eachEntryFunc func(event *filer_pb.SubscribeMetadataResponse) error) {
prefix := *dir
if !strings.HasSuffix(prefix, "/") {
prefix = prefix + "/"
}
metadataFollowOption := &pb.MetadataFollowOption{
ClientName: "tail",
ClientId: 0,
ClientEpoch: 0,
SelfSignature: 0,
PathPrefix: *dir,
PathPrefix: prefix,
AdditionalPathPrefixes: nil,
DirectoriesToWatch: nil,
StartTsNs: 0,