mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-21 04:28:04 +08:00
fix file listing
This commit is contained in:
@@ -268,22 +268,19 @@ func (store *ArangodbStore) ListDirectoryPrefixedEntries(ctx context.Context, di
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (store *ArangodbStore) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
func (store *ArangodbStore) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
||||||
dir, name := dirPath.DirAndName()
|
|
||||||
eq := ""
|
eq := ""
|
||||||
if includeStartFile {
|
if !includeStartFile {
|
||||||
eq = "="
|
eq = "filter d.name != \"" + startFileName + "\""
|
||||||
}
|
}
|
||||||
_ = eq
|
fmt.Println(dirPath, startFileName, includeStartFile)
|
||||||
_ = name
|
query := fmt.Sprintf(`
|
||||||
|
|
||||||
cur, err := store.database.Query(ctx, fmt.Sprintf(`
|
|
||||||
for d in files
|
for d in files
|
||||||
filter d.directory == @dir
|
filter d.directory == "%s"
|
||||||
sort d.name desc
|
sort d.name desc
|
||||||
|
%s
|
||||||
limit %d
|
limit %d
|
||||||
return d`, limit), map[string]interface{}{
|
return d`, string(dirPath), eq, limit)
|
||||||
"dir": dir,
|
cur, err := store.database.Query(ctx, query, nil)
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return lastFileName, fmt.Errorf("failed to list directory entries: find error: %w", err)
|
return lastFileName, fmt.Errorf("failed to list directory entries: find error: %w", err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user