Skip to content

Commit 7feee28

Browse files
Merge pull request #349 from TransactionProcessing/bug/#336_handleautologonfailurebetter
Handle failing operator auto logons
2 parents 24b4c1c + c422a2a commit 7feee28

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

TransactionProcessor/Extensions.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,17 @@ private static SubscriptionWorker ConfigureOrderedSubscriptions(ISubscriptionRep
172172

173173
private static void OperatorLogon(String operatorId)
174174
{
175+
try {
176+
Logger.LogInformation($"About to do auto logon for operator Id [{operatorId}]");
177+
Func<String, IOperatorProxy> resolver = Startup.ServiceProvider.GetService<Func<String, IOperatorProxy>>();
178+
IOperatorProxy proxy = resolver(operatorId);
175179

176-
Logger.LogInformation($"About to do auto logon for operator Id [{operatorId}]");
177-
Func<String, IOperatorProxy> resolver = Startup.ServiceProvider.GetService<Func<String, IOperatorProxy>>();
178-
IOperatorProxy proxy = resolver(operatorId);
179-
180-
OperatorResponse logonResult = proxy.ProcessLogonMessage(null, CancellationToken.None).Result;
181-
Logger.LogInformation($"Auto logon for operator Id [{operatorId}] status [{logonResult.IsSuccessful}]");
180+
OperatorResponse logonResult = proxy.ProcessLogonMessage(null, CancellationToken.None).Result;
181+
Logger.LogInformation($"Auto logon for operator Id [{operatorId}] status [{logonResult.IsSuccessful}]");
182+
}
183+
catch(Exception ex) {
184+
Logger.LogWarning($"Auto logon for operator Id [{operatorId}] failed.");
185+
}
182186
}
183187
}
184188

0 commit comments

Comments
 (0)