This commit is contained in:
StellaOps Bot
2025-12-09 00:20:52 +02:00
parent 3d01bf9edc
commit bc0762e97d
261 changed files with 14033 additions and 4427 deletions

View File

@@ -125,6 +125,7 @@ builder.Services.AddSingleton<IMongoCollection<UnknownSymbolDocument>>(sp =>
});
builder.Services.AddSingleton<ICallgraphRepository, MongoCallgraphRepository>();
builder.Services.AddSingleton<ICallgraphNormalizationService, CallgraphNormalizationService>();
// Configure callgraph artifact storage based on driver
if (bootstrap.Storage.IsRustFsDriver())
@@ -165,7 +166,31 @@ builder.Services.AddSingleton<IReachabilityCache>(sp =>
var options = sp.GetRequiredService<IOptions<SignalsOptions>>().Value;
return new RedisReachabilityCache(options.Cache);
});
builder.Services.AddSingleton<IEventsPublisher, InMemoryEventsPublisher>();
builder.Services.AddSingleton<IRedisConnectionFactory, RedisConnectionFactory>();
builder.Services.AddSingleton<ReachabilityFactEventBuilder>();
builder.Services.AddSingleton<IEventsPublisher>(sp =>
{
var options = sp.GetRequiredService<SignalsOptions>();
var eventBuilder = sp.GetRequiredService<ReachabilityFactEventBuilder>();
if (!options.Events.Enabled)
{
return new NullEventsPublisher();
}
if (string.Equals(options.Events.Driver, "redis", StringComparison.OrdinalIgnoreCase))
{
return new RedisEventsPublisher(
options,
sp.GetRequiredService<IRedisConnectionFactory>(),
eventBuilder,
sp.GetRequiredService<ILogger<RedisEventsPublisher>>());
}
return new InMemoryEventsPublisher(
sp.GetRequiredService<ILogger<InMemoryEventsPublisher>>(),
eventBuilder);
});
builder.Services.AddSingleton<IReachabilityFactRepository>(sp =>
{
var inner = sp.GetRequiredService<MongoReachabilityFactRepository>();