From 6b458a64f519b8d5c90f37ceec4f9e3a42d06927 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 6 Nov 2025 22:30:29 -0800 Subject: [PATCH] clean up --- weed/filer/foundationdb/foundationdb_store.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/weed/filer/foundationdb/foundationdb_store.go b/weed/filer/foundationdb/foundationdb_store.go index 17f5a6ba8..b7df8a7eb 100644 --- a/weed/filer/foundationdb/foundationdb_store.go +++ b/weed/filer/foundationdb/foundationdb_store.go @@ -383,7 +383,11 @@ func (store *FoundationDBStore) ListDirectoryPrefixedEntries(ctx context.Context if err != nil { return "", fmt.Errorf("scanning %s: %w", dirPath, err) } - kvs = result.([]fdb.KeyValue) + var ok bool + kvs, ok = result.([]fdb.KeyValue) + if !ok { + return "", fmt.Errorf("unexpected type from ReadTransact: %T, expected []fdb.KeyValue", result) + } } for _, kv := range kvs { @@ -487,13 +491,6 @@ func (store *FoundationDBStore) genKey(dirPath, fileName string) fdb.Key { return store.seaweedfsDir.Pack(tuple.Tuple{dirPath, fileName}) } -func (store *FoundationDBStore) genDirectoryKeyPrefix(dirPath, prefix string) fdb.Key { - if prefix == "" { - return store.seaweedfsDir.Pack(tuple.Tuple{dirPath, ""}) - } - return store.seaweedfsDir.Pack(tuple.Tuple{dirPath, prefix}) -} - func (store *FoundationDBStore) extractFileName(key fdb.Key) (string, error) { t, err := store.seaweedfsDir.Unpack(key) if err != nil {