diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-01-14 23:10:37 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-01-14 23:10:37 -0800 |
| commit | f002e668def4abdfda5fe8a76599ae6d0fb76319 (patch) | |
| tree | dce928f9f851226ce64df118fa9b892aea43f1a3 /weed/filer/mongodb/mongodb_store.go | |
| parent | 19e52fd4146d32b4da48a3369385442e836a7647 (diff) | |
| download | seaweedfs-f002e668def4abdfda5fe8a76599ae6d0fb76319.tar.xz seaweedfs-f002e668def4abdfda5fe8a76599ae6d0fb76319.zip | |
change limit to int64 in case of overflow
Diffstat (limited to 'weed/filer/mongodb/mongodb_store.go')
| -rw-r--r-- | weed/filer/mongodb/mongodb_store.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filer/mongodb/mongodb_store.go b/weed/filer/mongodb/mongodb_store.go index 5f601aae3..2549b6029 100644 --- a/weed/filer/mongodb/mongodb_store.go +++ b/weed/filer/mongodb/mongodb_store.go @@ -178,11 +178,11 @@ func (store *MongodbStore) DeleteFolderChildren(ctx context.Context, fullpath ut return nil } -func (store *MongodbStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int, prefix string) (entries []*filer.Entry, hasMore bool, err error) { +func (store *MongodbStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, prefix string) (entries []*filer.Entry, hasMore bool, err error) { return nil, false, filer.ErrUnsupportedListDirectoryPrefixed } -func (store *MongodbStore) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int) (entries []*filer.Entry, hasMore bool, err error) { +func (store *MongodbStore) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64) (entries []*filer.Entry, hasMore bool, err error) { var where = bson.M{"directory": string(dirPath), "name": bson.M{"$gt": startFileName}} if includeStartFile { @@ -212,7 +212,7 @@ func (store *MongodbStore) ListDirectoryEntries(ctx context.Context, dirPath uti entries = append(entries, entry) } - hasMore = len(entries) == limit + 1 + hasMore = int64(len(entries)) == limit + 1 if hasMore { entries = entries[:limit] } |
