From a873a8981b1989f631f08c8b3fede97d3ebe303a Mon Sep 17 00:00:00 2001 From: Ethan Freestone Date: Wed, 16 Oct 2024 10:44:28 +0100 Subject: [PATCH] chore: Removed commented code Remove old commented out code --- .../org/olf/TitleIngestService.groovy | 2 +- .../olf/general/pushKB/PushKBService.groovy | 47 ------------------- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/service/grails-app/services/org/olf/TitleIngestService.groovy b/service/grails-app/services/org/olf/TitleIngestService.groovy index 9d48f256..3ed9e787 100644 --- a/service/grails-app/services/org/olf/TitleIngestService.groovy +++ b/service/grails-app/services/org/olf/TitleIngestService.groovy @@ -36,7 +36,7 @@ class TitleIngestService implements DataBinder { TitleInstance.withNewTransaction { if (!kb) { // This KB is created without a Type... so if it was trusted for TI data then it'd fail secondary enrichment - kb = new RemoteKB( name:remotekbname, + kb = new RemoteKB( name:remotekbname, rectype: RemoteKB.RECTYPE_TITLE, active: Boolean.TRUE, readonly:readOnly, diff --git a/service/grails-app/services/org/olf/general/pushKB/PushKBService.groovy b/service/grails-app/services/org/olf/general/pushKB/PushKBService.groovy index ad2030c6..68078593 100644 --- a/service/grails-app/services/org/olf/general/pushKB/PushKBService.groovy +++ b/service/grails-app/services/org/olf/general/pushKB/PushKBService.groovy @@ -200,53 +200,6 @@ class PushKBService implements DataBinder { } } - // FIXME trying with aggressive session managemnet and clearing as in ingest service -- might not work - /* Pkg.withNewTransaction { status -> - // TODO this will allow the PCI data to update the PKG record... do we want this? - log.debug("Before package look") - - pkg = packageIngestService.lookupOrCreatePackageFromTitle(pc); - log.debug("LOGGING PACKAGE OBTAINED FROM PCI: ${pkg}") - - Map titleIngestResult = titleIngestService.upsertTitleDirect(pc) - log.debug("LOGGING titleIngestResult: ${titleIngestResult}") - - if ( titleIngestResult.titleInstanceId != null ) { - log.debug("Before lookupOrCreateTitleHierarchy") - - Map hierarchyResult = packageIngestService.lookupOrCreateTitleHierarchy( - titleIngestResult.titleInstanceId, - pkg.id, - true, - pc, - result.updateTime, - result.titleCount // FIXME not sure about this - ) - - PackageContentItem pci = PackageContentItem.get(hierarchyResult.pciId) - packageIngestService.hierarchyResultMapLogic(hierarchyResult, result, pci) - log.debug("After lookupOrCreateTitleHierarchy") - - /* TODO figure out if use of removedTimestamp - * should be something harvest also needs to do directly - * And whether we should be doing it after all the above - * or before. - * / - if (pc.removedTimestamp) { - try { - log.debug("Removal candidate: pci.id #${pci.id} (Last seen ${pci.lastSeenTimestamp}, thisUpdate ${result.updateTime}) -- Set removed") - pci.removedTimestamp = pc.removedTimestamp - pci.save(failOnError:true) - } catch ( Exception e ) { - log.error("Problem removing ${pci} in package load", e) - } - result.removedTitles++ - } - } else { - String message = "Skipping \"${pc.title}\". Unable to resolve title from ${pc.title} with identifiers ${pc.instanceIdentifiers}" - log.error(message) - } - } */ } catch ( IngestException ie ) { // When we've caught an ingest exception, should have helpful error log message String message = "Skipping \"${pc.title}\": ${ie.message}"