Browse Source

clean up

pull/7178/head
chrislu 4 weeks ago
parent
commit
6b458a64f5
  1. 13
      weed/filer/foundationdb/foundationdb_store.go

13
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 {

Loading…
Cancel
Save