From 97bb9b2c5f477a667094ee74eeb015910c7384f9 Mon Sep 17 00:00:00 2001 From: sceox Date: Mon, 7 Mar 2022 12:37:52 -0800 Subject: [PATCH] set a higher query size limit when querying all rooms By default, the synapse admin API limits the rooms query to 100 results. This was causing the purges to apply to ~5% of rooms on our server. Now we set a higher limit for the room query. --- synapse-purge-compress.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/synapse-purge-compress.sh b/synapse-purge-compress.sh index 8dcb7e6..72f2a51 100755 --- a/synapse-purge-compress.sh +++ b/synapse-purge-compress.sh @@ -7,6 +7,7 @@ host='localhost' port='8008' synapse_log='/var/log/matrix-synapse/homeserver.log' homeserver_config='/etc/matrix-synapse/homeserver.yaml' +rooms_query_limit=6666 debug=0 @@ -46,7 +47,7 @@ get_synapse_version () { get_all_rooms () { curl --silent -H "Authorization: Bearer $token" \ - "${host}:${port}/_synapse/admin/v1/rooms" \ + "${host}:${port}/_synapse/admin/v1/rooms?limit=${rooms_query_limit}" \ | jq '.rooms[].room_id' \ | sed 's/"//g' }