summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2021-01-29 14:06:16 +0100
committerOndrej Holy <oholy@redhat.com>2021-02-12 14:48:02 +0100
commit530b55586461206f5c836e8b3a9e6625c560474e (patch)
tree1f1b30e59c86cea2bf556c8e8b6b2d9bf85cf374
parent4bf0aa8e38d64c92650226b28df38be35a86b4f9 (diff)
downloadgvfs-530b55586461206f5c836e8b3a9e6625c560474e.tar.gz
google: Increase number of results in batches for better performance
Currently, only 50 results are returned in one batch, which means that multiple network requests are needed for folders with a lot files, which makes it slow. I am not sure there was some reason for this limitation earlier (e.g. before the cache rework), however, I don't see any rationals for it currently. Let's increase this to its maximum for better performance.
-rw-r--r--daemon/gvfsbackendgoogle.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index 777acb8a..1b5db93c 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -80,8 +80,6 @@ G_DEFINE_TYPE(GVfsBackendGoogle, g_vfs_backend_google, G_VFS_TYPE_BACKEND)
#define CONTENT_TYPE_PREFIX_GOOGLE "application/vnd.google-apps"
-#define MAX_RESULTS 50
-
#define REBUILD_ENTRIES_TIMEOUT 60 /* s */
#define URI_PREFIX "https://www.googleapis.com/drive/v2/files/"
@@ -907,7 +905,7 @@ rebuild_dir (GVfsBackendGoogle *self,
parent_id = g_strdup (gdata_entry_get_id (parent));
search = g_strdup_printf ("'%s' in parents", parent_id);
- query = gdata_documents_query_new_with_limits (search, 1, MAX_RESULTS);
+ query = gdata_documents_query_new_with_limits (search, 1, G_MAXUINT);
gdata_documents_query_set_show_folders (query, TRUE);
g_free (search);