Skip to content

Commit 7862ef1

Browse files
committed
Updated store and consul
1 parent c943cbe commit 7862ef1

File tree

10 files changed

+16
-8
lines changed

10 files changed

+16
-8
lines changed

Infrastructure/Consul/ConsulExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static IApplicationBuilder UseConsul(this IApplicationBuilder app, IHostA
6565
Tags = consulConfig.Value.Tags
6666
};
6767

68-
if (consulConfig.Value.EnableAgentCheck)
68+
if (!consulConfig.Value.DisableAgentCheck)
6969
{
7070
registration.Check = new AgentServiceCheck
7171
{

Infrastructure/Consul/ConsulOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ public class ConsulOptions
77
public string[] Tags { get; set; }
88
public string ConsulAddress { get; set; }
99
public string ServiceAddress { get; set; }
10-
public bool EnableAgentCheck { get; set; }
10+
public bool DisableAgentCheck { get; set; }
1111
}
1212
}

Infrastructure/EventStores/Stores/EfCore/EfCoreEventStoreContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ public class EfCoreEventStoreContext : DbContext
77
{
88
public EfCoreEventStoreContext(DbContextOptions<EfCoreEventStoreContext> options) : base(options)
99
{
10-
Database.EnsureCreated();
10+
if (!Database.CanConnect())
11+
{
12+
Database.EnsureCreated();
13+
}
1114
}
1215

1316
public DbSet<StreamState> Streams { get; set; }

Infrastructure/Outbox/Stores/EfCore/EfCoreOutboxContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ public class EfCoreOutboxContext : DbContext
66
{
77
public EfCoreOutboxContext(DbContextOptions<EfCoreOutboxContext> options) : base(options)
88
{
9-
Database.EnsureCreated();
9+
if (!Database.CanConnect())
10+
{
11+
Database.EnsureCreated();
12+
}
1013
}
1114

1215
public DbSet<OutboxMessage> OutboxMessages { get; set; }

Src/MoviesService/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"environmentVariables": {
2121
"ASPNETCORE_ENVIRONMENT": "Development"
2222
},
23-
"applicationUrl": "http://localhost:5002"
23+
"applicationUrl": "http://0.0.0.0:5002"
2424
},
2525
"Docker": {
2626
"commandName": "Docker",

Src/MoviesService/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"ConsulOptions": {
5252
"ConsulAddress": "http://consul:8500",
5353
"ServiceAddress": "http://movies_service",
54-
"EnableAgentCheck": false,
54+
"DisableAgentCheck": false,
5555
"Tags": []
5656
},
5757
"Serilog": {

Src/ReviewsService/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"environmentVariables": {
2121
"ASPNETCORE_ENVIRONMENT": "Development"
2222
},
23-
"applicationUrl": "http://localhost:5003"
23+
"applicationUrl": "http://0.0.0.0:5003"
2424
},
2525
"Docker": {
2626
"commandName": "Docker",

Src/ReviewsService/appsettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"ConsulOptions": {
5252
"ConsulAddress": "http://consul:8500",
5353
"ServiceAddress": "http://reviews_service",
54+
"DisableAgentCheck": false,
5455
"Tags": []
5556
},
5657
"Serilog": {

Src/UsersService/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"environmentVariables": {
2121
"ASPNETCORE_ENVIRONMENT": "Development"
2222
},
23-
"applicationUrl": "http://localhost:5001"
23+
"applicationUrl": "http://0.0.0.0:5001"
2424
},
2525
"Docker": {
2626
"commandName": "Docker",

Src/UsersService/appsettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"ConsulOptions": {
5252
"ConsulAddress": "http://consul:8500",
5353
"ServiceAddress": "http://users_service",
54+
"DisableAgentCheck": false,
5455
"Tags": []
5556
},
5657
"Serilog": {

0 commit comments

Comments
 (0)