up
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user