Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,17 @@ public void generate() throws Exception {
db.closeUp();
}
FileUtilities.bytesToFile(pf.extensionTracker.generate(), Utilities.path(pf.tempDir, "usage-stats.json"));
try {
log("Sending Usage Stats to Server");
pf.extensionTracker.sendToServer("http://test.fhir.org/usage-stats");
} catch (Exception e) {
log("Submitting Usage Stats failed: "+e.getMessage());
}
// Send usage stats asynchronously to avoid blocking the build
Thread usageStatsThread = new Thread(() -> {
try {
pf.extensionTracker.sendToServer("http://test.fhir.org/usage-stats");
} catch (Exception e) {
// fire-and-forget: don't block the build for telemetry
}
}, "usage-stats-sender");
usageStatsThread.setDaemon(true);
usageStatsThread.start();
log("Sending Usage Stats to Server (async)");

pf.realmRules.addOtherFiles(pf.otherFilesRun, pf.outputDir);
pf.previousVersionComparator.addOtherFiles(pf.otherFilesRun, pf.outputDir, pf.getExemptHtmlPatterns());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public class ValidationServices implements IValidatorResourceFetcher, IValidatio
private List<PublisherUtils.LinkedSpecification> linkSpecMaps;
private IPublisherModule module;
private static boolean nsFailHasFailed = false; // work around for an THO 6.0.0 problem
private Set<String> namingSystemUrls; // cached URL set for resolveURL lookups


public ValidationServices(IWorkerContext context, IGKnowledgeProvider ipg, ImplementationGuide ig, List<FetchedFile> files, List<NpmPackage> packages,
Expand Down Expand Up @@ -384,12 +385,23 @@ public boolean resolveURL(IResourceValidator validator, Object appContext, Strin
}
}
try {
for (NamingSystem ns : context.fetchResourcesByType(NamingSystem.class)) {
if (hasURL(ns, u)) {
// ignore the version?
return true;
if (namingSystemUrls == null) {
namingSystemUrls = new HashSet<>();
for (NamingSystem ns : context.fetchResourcesByType(NamingSystem.class)) {
for (NamingSystemUniqueIdComponent uid : ns.getUniqueId()) {
if (uid.hasValue()) {
if (uid.getType() == NamingSystemIdentifierType.URI) {
namingSystemUrls.add(uid.getValue());
} else if (uid.getType() == NamingSystemIdentifierType.OID) {
namingSystemUrls.add("urn:oid:" + uid.getValue());
}
}
}
}
}
if (namingSystemUrls.contains(u)) {
return true;
}
} catch (Exception e) {
if (!nsFailHasFailed) {
e.printStackTrace();
Expand Down