about summary refs log tree commit diff
path: root/LibMatrix/Helpers/SyncHelper.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-08-23 02:55:07 +0200
committerRory& <root@rory.gay>2024-12-15 02:17:22 +0100
commitdb965b8bc3528814467713cb3467ac98da4e2df6 (patch)
tree43dbe61a19234af9697902dae7ac12812a2de179 /LibMatrix/Helpers/SyncHelper.cs
parentMinor cleanup (diff)
downloadLibMatrix-db965b8bc3528814467713cb3467ac98da4e2df6.tar.xz
Synapse admin API stuff, a mass of other changes
Diffstat (limited to '')
-rw-r--r--LibMatrix/Helpers/SyncHelper.cs6
1 files changed, 6 insertions, 0 deletions
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<int> 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);