diff --git a/NEWS.md b/NEWS.md index b631add4..1ef96601 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +## 7.1.2 + * ERM-3455 pushPkg endpoint in mod-agreements works unexpectedly slowly + ## 7.1.1 2024-11-27 * ERM-3425: Missing interface dependencies in module descriptor in mod-agreements diff --git a/service/gradle.properties b/service/gradle.properties index c8cb5792..faff3950 100644 --- a/service/gradle.properties +++ b/service/gradle.properties @@ -4,7 +4,7 @@ gormVersion=8.0.3 # Application appName=mod-agreements -appVersion=7.1.1 +appVersion=7.1.2 okapiInterfaceVersion=7.1 dockerTagSuffix= dockerRepo=folioci diff --git a/service/grails-app/services/org/olf/DependentModuleProxyService.groovy b/service/grails-app/services/org/olf/DependentModuleProxyService.groovy index dab86d77..04e233c9 100644 --- a/service/grails-app/services/org/olf/DependentModuleProxyService.groovy +++ b/service/grails-app/services/org/olf/DependentModuleProxyService.groovy @@ -21,11 +21,10 @@ public class DependentModuleProxyService { OkapiClient okapiClient public Org coordinateOrg(String orgName) { - // Simply call the verb method on the client (get, post, put, delete). The client itself should take care of everything else. // Get and Delete take the uri with optional params map for the query string. // Post, Put and Patch take in the uri, data that can be converted to json (String or map) and optional params map for the query string. - Org org = Org.findByName(orgName) + Org org = Org.findByName(orgName) // This cannot be swapped for executeQuery SELECT -- possibly due to the bindUsingWhenRef if (!org) { log.debug "No local org for ${orgName}. Check vendors." @@ -51,7 +50,7 @@ public class DependentModuleProxyService { "first" : 0, "last" : 0 } - */ + */ switch (mod_vendor_lookup_result.total_records) { case 1: @@ -62,7 +61,7 @@ public class DependentModuleProxyService { name: result.name, orgsUuid: result.id, sourceURI: "/vendor/${result.id}" - ).save( flush:true, failOnError:true ) + ).save( flush: true, failOnError:true ) break case 0: @@ -74,7 +73,7 @@ public class DependentModuleProxyService { // Create a new local one. log.debug "No vendor found. Adding local org for ${orgName}" - org = (new Org(name:orgName)).save(flush:true, failOnError:true) + org = (new Org(name:orgName)).save( flush: true, failOnError:true ) break default: 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 15070769..072199e0 100644 --- a/service/grails-app/services/org/olf/general/pushKB/PushKBService.groovy +++ b/service/grails-app/services/org/olf/general/pushKB/PushKBService.groovy @@ -71,20 +71,26 @@ class PushKBService implements DataBinder { if (utilityService.checkValidBinding(package_data)) { // Start a transaction -- method in packageIngestService needs this - Pkg.withNewTransaction { status -> - // Farm out package lookup and creation to a separate method - - // These calls mirror what's in upsertPackage but conveniently avoid the - // logic which handles TIPPS - Pkg pkg = packageIngestService.lookupOrCreatePkg(package_data); - // Retain logging information - MDC.put('packageSource', pkg.source.toString()) - MDC.put('packageReference', pkg.reference.toString()) - - // Update identifiers from citation - identifierService.updatePackageIdentifiers(pkg, package_data.identifiers) + Pkg.withSession { currentSess -> + Pkg.withTransaction { + Pkg.withNewSession { newSess -> + Pkg.withTransaction { + // Farm out package lookup and creation to a separate method + + // These calls mirror what's in upsertPackage but conveniently avoid the + // logic which handles TIPPS + Pkg pkg = packageIngestService.lookupOrCreatePkg(package_data); + // Retain logging information + MDC.put('packageSource', pkg.source.toString()) + MDC.put('packageReference', pkg.reference.toString()) + + // Update identifiers from citation + identifierService.updatePackageIdentifiers(pkg, package_data.identifiers) + } + newSess.clear() + } + } } - } } result.success = true