mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-08 05:48:12 +00:00
handle tx ecosystem failure properly
This commit is contained in:
parent
2c359f64f9
commit
6ab2bb518d
@ -160,6 +160,8 @@ public class TerminologyClientManager {
|
|||||||
|
|
||||||
private ILoggingService logger;
|
private ILoggingService logger;
|
||||||
|
|
||||||
|
private int ecosystemfailCount;
|
||||||
|
|
||||||
public TerminologyClientManager(ITerminologyClientFactory factory, String cacheId, ILoggingService logger) {
|
public TerminologyClientManager(ITerminologyClientFactory factory, String cacheId, ILoggingService logger) {
|
||||||
super();
|
super();
|
||||||
this.factory = factory;
|
this.factory = factory;
|
||||||
@ -566,6 +568,8 @@ public class TerminologyClientManager {
|
|||||||
if (!useEcosystem) {
|
if (!useEcosystem) {
|
||||||
server = getMasterClient().getAddress();
|
server = getMasterClient().getAddress();
|
||||||
} else {
|
} else {
|
||||||
|
ecosystemfailCount = 0;
|
||||||
|
try {
|
||||||
if (usage != null) {
|
if (usage != null) {
|
||||||
request = request + "&usage="+usage;
|
request = request + "&usage="+usage;
|
||||||
}
|
}
|
||||||
@ -589,6 +593,21 @@ public class TerminologyClientManager {
|
|||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// the ecosystem cal failed, so we're just going to fall back to
|
||||||
|
String msg = "Error resolving valueSet "+canonical+": "+e.getMessage();
|
||||||
|
if (!hasMessage(msg)) {
|
||||||
|
internalLog.add(new InternalLogEvent(msg, canonical, request));
|
||||||
|
}
|
||||||
|
if (logger.isDebugLogging()) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
ecosystemfailCount++;
|
||||||
|
if (ecosystemfailCount > 3) {
|
||||||
|
useEcosystem = false;
|
||||||
|
}
|
||||||
|
server = getMasterClient().getAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TerminologyClientContext client = serverMap.get(server);
|
TerminologyClientContext client = serverMap.get(server);
|
||||||
if (client == null) {
|
if (client == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user