Skip to content

Commit

Permalink
feat: use pooled db context
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILLIPS71 committed Jun 3, 2024
1 parent abe7680 commit 0cfb015
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Service.Encoder/src/Persistence/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class Setup
public static IServiceCollection SetupPersistence(this IServiceCollection services, IConfiguration configuration)
{
services
.AddDbContext<ApplicationDbContext>(options =>
.AddDbContextPool<ApplicationDbContext>(options =>
{
options
.UseNpgsql(configuration.GetConnectionString(name: "DatabaseConnection"), optionsBuilder =>
Expand All @@ -36,8 +36,6 @@ public static IServiceCollection SetupPersistence(this IServiceCollection servic
options.Role = "transport";
options.Username = builder.Username;
options.Password = builder.Password;
options.AdminUsername = builder.Username;
options.AdminPassword = builder.Password;
});

services
Expand Down
4 changes: 1 addition & 3 deletions src/Service.Orchestrator/src/Persistence/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class Setup
public static IServiceCollection SetupPersistence(this IServiceCollection services, IConfiguration configuration)
{
services
.AddDbContext<ApplicationDbContext>(options =>
.AddDbContextPool<ApplicationDbContext>(options =>
{
options
.UseNpgsql(configuration.GetConnectionString(name: "DatabaseConnection"), optionsBuilder =>
Expand All @@ -41,8 +41,6 @@ public static IServiceCollection SetupPersistence(this IServiceCollection servic
options.Role = "transport";
options.Username = builder.Username;
options.Password = builder.Password;
options.AdminUsername = builder.Username;
options.AdminPassword = builder.Password;
});

services
Expand Down

0 comments on commit 0cfb015

Please sign in to comment.