🐛 Fix use wrong DI type in cache service

This commit is contained in:
2025-12-02 22:45:30 +08:00
parent aca28f9318
commit a02ed10434

View File

@@ -64,7 +64,7 @@ public static class Extensions
options.Configuration = builder.Configuration.GetConnectionString("cache"); options.Configuration = builder.Configuration.GetConnectionString("cache");
options.InstanceName = "dyson:"; options.InstanceName = "dyson:";
}); });
builder.Services.AddSingleton<RedLockFactory>(sp => builder.Services.AddSingleton<IDistributedLockFactory, RedLockFactory>(sp =>
{ {
var mux = sp.GetRequiredService<IConnectionMultiplexer>(); var mux = sp.GetRequiredService<IConnectionMultiplexer>();
return RedLockFactory.Create(new List<RedLockMultiplexer> { new(mux) }); return RedLockFactory.Create(new List<RedLockMultiplexer> { new(mux) });