Skip to content

Commit

Permalink
Fix resolver config
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed May 8, 2024
1 parent 39f1c78 commit 42ece53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
18 changes: 4 additions & 14 deletions Cron/CronConf.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
namespace OpenShock.Cron;
using OpenShock.ServicesCommon.Config;

public sealed class CronConf
{
public required string Db { get; init; }
public required RedisConfig Redis { get; init; }

public class RedisConfig
{
public required string Host { get; init; }
public required string User { get; init; }
public required string Password { get; init; }
public required ushort Port { get; init; }
}
}
namespace OpenShock.Cron;

public sealed class CronConf : BaseConfig;
4 changes: 2 additions & 2 deletions Cron/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@
#pragma warning restore CS0618
services.AddDbContextPool<OpenShockContext>(builder =>
{
builder.UseNpgsql(config.Db);
builder.UseNpgsql(config.Db.Conn);
builder.EnableSensitiveDataLogging();
builder.EnableDetailedErrors();
});

services.AddDbContextFactory<OpenShockContext>(builder =>
{
builder.UseNpgsql(config.Db);
builder.UseNpgsql(config.Db.Conn);
builder.EnableSensitiveDataLogging();
builder.EnableDetailedErrors();
});
Expand Down
2 changes: 2 additions & 0 deletions LiveControlGateway/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public Startup(IConfiguration configuration)
/// <param name="services"></param>
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton(_lcgConfig);

// ----------------- DATABASE -----------------

// How do I do this now with EFCore?!
Expand Down

0 comments on commit 42ece53

Please sign in to comment.