up
Some checks failed
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Policy Simulation / policy-simulate (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled

This commit is contained in:
StellaOps Bot
2025-12-13 09:37:15 +02:00
parent e00f6365da
commit 6e45066e37
349 changed files with 17160 additions and 1867 deletions

View File

@@ -0,0 +1,52 @@
using StellaOps.Messaging;
using StellaOps.Messaging.Abstractions;
namespace StellaOps.Concelier.WebService.Services;
/// <summary>
/// Advisory chunk cache backed by <see cref="IDistributedCache{TValue}"/>.
/// Supports any transport (InMemory, Valkey, PostgreSQL) via factory injection.
/// </summary>
internal sealed class MessagingAdvisoryChunkCache : IAdvisoryChunkCache
{
private readonly IDistributedCache<AdvisoryChunkBuildResult> _cache;
public MessagingAdvisoryChunkCache(IDistributedCacheFactory cacheFactory)
{
ArgumentNullException.ThrowIfNull(cacheFactory);
_cache = cacheFactory.Create<AdvisoryChunkBuildResult>(new CacheOptions
{
KeyPrefix = "advisory:chunk:",
});
}
public bool TryGet(in AdvisoryChunkCacheKey key, out AdvisoryChunkBuildResult result)
{
// Sync-over-async for compatibility with existing interface
// Consider migrating callers to async in future
var task = _cache.GetAsync(key.Value);
var cacheResult = task.AsTask().GetAwaiter().GetResult();
if (cacheResult.HasValue)
{
result = cacheResult.Value;
return true;
}
result = null!;
return false;
}
public void Set(in AdvisoryChunkCacheKey key, AdvisoryChunkBuildResult value, TimeSpan ttl)
{
if (ttl <= TimeSpan.Zero)
{
return;
}
var entryOptions = new CacheEntryOptions { TimeToLive = ttl };
// Sync-over-async for compatibility with existing interface
_cache.SetAsync(key.Value, value, entryOptions).AsTask().GetAwaiter().GetResult();
}
}

View File

@@ -28,6 +28,7 @@
<ProjectReference Include="../__Libraries/StellaOps.Concelier.Connector.Common/StellaOps.Concelier.Connector.Common.csproj" />
<ProjectReference Include="../__Libraries/StellaOps.Concelier.Merge/StellaOps.Concelier.Merge.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Plugin/StellaOps.Plugin.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Messaging/StellaOps.Messaging.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.DependencyInjection/StellaOps.DependencyInjection.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Configuration/StellaOps.Configuration.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Cryptography/StellaOps.Cryptography.csproj" />