Skip to content

Commit 559caca

Browse files
Updates managed item cache after retrieval
Ensures the local cache of managed certificate items is updated whenever an item is retrieved. This helps keep the cache synchronized with the actual state.
1 parent 8a95a31 commit 559caca

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Certify.Server/Certify.Server.Hub.Api/Services/ManagementAPI.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,15 @@ private async Task SendCommandWithNoResult(string instanceId, InstanceCommandReq
160160
new("managedCertId", managedCertId)
161161
};
162162

163-
return await PerformInstanceCommandTaskWithResult<ManagedCertificate?>(instanceId, args, ManagementHubCommands.GetManagedItem);
163+
var result = await PerformInstanceCommandTaskWithResult<ManagedCertificate?>(instanceId, args, ManagementHubCommands.GetManagedItem);
164+
165+
if (result != null)
166+
{
167+
// update local cache
168+
_mgmtStateProvider.UpdateCachedManagedInstanceItem(instanceId, result);
169+
}
170+
171+
return result;
164172
}
165173

166174
/// <summary>

0 commit comments

Comments
 (0)