mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 23:30:36 +08:00
avoid int bigger than math.MaxInt32
fix https://github.com/chrislusf/seaweedfs/issues/2363
This commit is contained in:
@@ -3,6 +3,7 @@ package filer
|
||||
import (
|
||||
"context"
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
"math"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -120,6 +121,10 @@ func (t *FilerStorePathTranlator) ListDirectoryPrefixedEntries(ctx context.Conte
|
||||
|
||||
newFullPath := t.translatePath(dirPath)
|
||||
|
||||
if limit > math.MaxInt32-1 {
|
||||
limit = math.MaxInt32 - 1
|
||||
}
|
||||
|
||||
return t.actualStore.ListDirectoryPrefixedEntries(ctx, newFullPath, startFileName, includeStartFile, limit, prefix, func(entry *Entry) bool {
|
||||
entry.FullPath = dirPath[:len(t.storeRoot)-1] + entry.FullPath
|
||||
return eachEntryFunc(entry)
|
||||
|
Reference in New Issue
Block a user