Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions TestHosts/TestHosts/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public PendingPrePaymentProcessor(IDbContextResolver<PataPawaContext> resolver){
protected override async Task ExecuteAsync(CancellationToken stoppingToken){
while (stoppingToken.IsCancellationRequested == false){
try {
// TODO: may introduce a date filter
using ResolvedDbContext<PataPawaContext>? resolvedContext = this.Resolver.Resolve("PataPawaReadModel");

var pendingTransactions = await resolvedContext.Context.Transactions.Where(t => t.IsPending).OrderBy(t => t.Date).ToListAsync(stoppingToken);
Expand Down Expand Up @@ -106,18 +105,12 @@ public async Task StartAsync(CancellationToken cancellationToken)
// Example: apply migrations or seed data
await pataPawaContext.Database.MigrateAsync(cancellationToken);
}
//else {
// await pataPawaContext.Database.EnsureCreatedAsync(cancellationToken);
//}


TestBankContext bankContext = scope.ServiceProvider.GetRequiredService<TestBankContext>();
if (bankContext.Database.IsRelational()) {
await bankContext.Database.MigrateAsync(cancellationToken);
}
//else {
// await bankContext.Database.EnsureCreatedAsync(cancellationToken);
//}


Logger.LogWarning("Database initialization completed successfully.");
}
catch (Exception ex)
Expand Down
Loading