@page "/DevOptions" @using MatrixRoomUtils.Core.Extensions @inject NavigationManager NavigationManager @inject ILocalStorageService LocalStorage Developer options

Rory&::MatrixUtils - Developer options






View caches

Generic cache:

@code { protected override async Task OnInitializedAsync() { await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); await base.OnInitializedAsync(); Task.Run(async () => { while (true) { await Task.Delay(1000); StateHasChanged(); } }); } protected async Task LogStuff() { await Task.Delay(100); Console.WriteLine($"Settings: {LocalStorageWrapper.Settings.ToJson()}"); await LocalStorageWrapper.SaveToLocalStorage(LocalStorage); } protected async Task DropCaches() { RuntimeCache.GenericResponseCache.Clear(); RuntimeCache.HomeserverResolutionCache.Clear(); await LocalStorageWrapper.SaveCacheToLocalStorage(LocalStorage); } protected async Task RandomiseCacheTimers() { foreach (var keyValuePair in RuntimeCache.GenericResponseCache) { Console.WriteLine($"Randomising cache timer for {keyValuePair.Key}"); foreach (var cacheItem in keyValuePair.Value.Cache) { cacheItem.Value.ExpiryTime = DateTime.Now.AddSeconds(Random.Shared.Next(15, 120)); } await LocalStorageWrapper.SaveCacheToLocalStorage(LocalStorage); } } }