From db965b8bc3528814467713cb3467ac98da4e2df6 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 23 Aug 2024 02:55:07 +0200 Subject: Synapse admin API stuff, a mass of other changes --- LibMatrix/Helpers/SyncHelper.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'LibMatrix/Helpers/SyncHelper.cs') diff --git a/LibMatrix/Helpers/SyncHelper.cs b/LibMatrix/Helpers/SyncHelper.cs index ae033f1..a7010ee 100644 --- a/LibMatrix/Helpers/SyncHelper.cs +++ b/LibMatrix/Helpers/SyncHelper.cs @@ -56,6 +56,12 @@ public class SyncHelper(AuthenticatedHomeserverGeneric homeserver, ILogger? logg public TimeSpan MinimumDelay { get; set; } = new(0); + public async Task GetUnoptimisedStoreCount() { + if (storageProvider is null) return -1; + var keys = await storageProvider.GetAllKeysAsync(); + return keys.Count(x => !x.StartsWith("old/")) - 1; + } + private async Task UpdateFilterAsync() { if (!string.IsNullOrWhiteSpace(NamedFilterName)) { _filterId = await homeserver.NamedCaches.FilterCache.GetOrSetValueAsync(NamedFilterName); -- cgit 1.5.1