Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions TransactionProcessing.MerchantPos/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@

builder.Services.RegisterHttpClient<ISecurityServiceClient, SecurityServiceClient>();
builder.Services.RegisterHttpClient<ITransactionProcessorClient, TransactionProcessorClient>();
builder.Services.AddHttpClient();
builder.Services.AddScoped<IEfRepository, EfRepository>();
builder.Services.AddScoped<IApiClient, ApiClient>();
builder.Services.AddScoped<MerchantRuntime>();
builder.Services.AddHttpClient<IApiClient, ApiClient>();
builder.Services.AddSingleton<IMerchantRuntimeFactory, MerchantRuntimeFactory>();

builder.Services.AddDbContext<MerchantDbContext>((sp, options) =>
Expand Down
17 changes: 12 additions & 5 deletions TransactionProcessing.MerchantPos/WorkerHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@ private void SyncMerchantWorkers(CancellationToken hostToken)
continue;
}

StartMerchantWorker(
(settings.ServiceClientId, settings.ServiceClientSecret),
(settings.ClientId, settings.ClientSecret),
merchant,
hostToken);
try
{
StartMerchantWorker(
(settings.ServiceClientId, settings.ServiceClientSecret),
(settings.ClientId, settings.ClientSecret),
merchant,
hostToken);
}
catch (Exception ex)
{
Logger.LogError($"Failed to start merchant worker for {merchant.MerchantName} ({merchant.MerchantId})", ex);
}
}
}

Expand Down
Loading