Added in memory caching

This commit is contained in:
barelyprofessional
2024-08-17 23:45:29 +08:00
parent b390368713
commit 71b46d73d2
10 changed files with 428 additions and 70 deletions

View File

@@ -9,5 +9,5 @@ public class BuiltInSettingsModel
public required string Description { get; set; }
public string? Default { get; set; }
public required bool IsSecret { get; set; }
public required TimeSpan CacheDuration { get; set; } = TimeSpan.Zero;
}

View File

@@ -16,4 +16,6 @@ public class SettingDbModel
public string? Default { get; set; } = null;
// Prevents the value from being revealed to Sneedchat when queried by an admin
public bool IsSecret { get; set; } = false;
// Number of seconds to cache in memory, 0 to not cache
public double CacheDuration { get; set; } = 0;
}