Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Core/Resgrid.Services/DepartmentSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class DepartmentSettingsService : IDepartmentSettingsService
private static string PaddleCustomerCacheKey = "DSetPaddleCus_{0}";
private static string BigBoardCenterGps = "DSetBBCenterGps_{0}";
private static string StaffingSupressInfo = "DSetStaffingSupress_{0}";
private static string ModuleSettingsCacheKey = "DSetModuleSettings_{0}";
private static string TtsLanguageCacheKey = "DSetTtsLanguage_{0}";
private static string PersonnelOnUnitSetUnitStatusCacheKey = "DSetPersonnelOnUnitSetUnitStatus_{0}";
private static string ModernNotificationsCacheKey = "DSetModernNotifications_{0}";
Expand Down Expand Up @@ -46,6 +47,11 @@ public DepartmentSettingsService(IDepartmentSettingsRepository departmentSetting

if (savedSetting == null)
{
// First-time write still needs to clear any cache populated by the fallback
// "new DepartmentModuleSettings()" in GetDepartmentModuleSettingsAsync (cached 365 days).
if (type == DepartmentSettingTypes.ModuleSettings)
await _cacheProvider.RemoveAsync(string.Format(ModuleSettingsCacheKey, departmentId));

DepartmentSetting newSetting = new DepartmentSetting();
newSetting.DepartmentId = departmentId;
newSetting.Setting = setting;
Expand All @@ -67,6 +73,9 @@ public DepartmentSettingsService(IDepartmentSettingsRepository departmentSetting
case DepartmentSettingTypes.StaffingSuppressStaffingLevels:
await _cacheProvider.RemoveAsync(string.Format(StaffingSupressInfo, departmentId));
break;
case DepartmentSettingTypes.ModuleSettings:
await _cacheProvider.RemoveAsync(string.Format(ModuleSettingsCacheKey, departmentId));
break;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
case DepartmentSettingTypes.TtsLanguage:
await _cacheProvider.RemoveAsync(string.Format(TtsLanguageCacheKey, departmentId));
break;
Expand Down Expand Up @@ -759,7 +768,7 @@ async Task<DepartmentModuleSettings> getSetting()

if (!bypassCache && Config.SystemBehaviorConfig.CacheEnabled)
{
var cachedValue = await _cacheProvider.RetrieveAsync<DepartmentModuleSettings>(string.Format(StaffingSupressInfo, departmentId),
var cachedValue = await _cacheProvider.RetrieveAsync<DepartmentModuleSettings>(string.Format(ModuleSettingsCacheKey, departmentId),
getSetting, ThatsNotLongThisIsLongCacheLength);

return cachedValue;
Expand Down
8 changes: 6 additions & 2 deletions Workers/Resgrid.Workers.Console/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
ARG BUILD_VERSION=3.5.0

#FROM mcr.microsoft.com/dotnet/runtime:9.0.3-noble-amd64 AS base
FROM dhi.io/dotnet:9.0.16-debian13@sha256:4797903e46b475875f4a402aa6f42a1dcc78cfe67d217f9f5f49e358b60d47a3 AS base
## Workers.Console transitively requires the ASP.NET Core shared framework
## (OpenIddict + the shared Services/Providers projects FrameworkReference
## Microsoft.AspNetCore.App), so the runtime-only "dhi.io/dotnet" image fails at
## launch with "No frameworks were found". Use the aspnetcore base instead.
#FROM mcr.microsoft.com/dotnet/aspnet:9.0.3-noble-amd64 AS base
FROM dhi.io/aspnetcore:9.0.16-debian13@sha256:961647e80202ce33fc06472dda4e7ae2d2bc56d819aee6742602f70047b13dc7 AS base
ARG BUILD_VERSION
WORKDIR /app

Expand Down
Loading