diff --git a/NEWS.md b/NEWS.md index ef297d25c..113ba1850 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +## 4.1.1 2021-07-28 + * ERM-1781 Error on adding coverage to PCI which overlaps with existing coverage on PTI/TI + * ERM-1777 Templated URL not updating on deletion of Proxy + ## 4.1.0 2021-06-15 * ERM-1730 Add renewalPriority to agreement widget definition * ERM-1724 Reduce running time for StringTemplateBulkSpec integration test diff --git a/service/gradle.properties b/service/gradle.properties index f0748fef4..c4b3d9052 100644 --- a/service/gradle.properties +++ b/service/gradle.properties @@ -11,6 +11,6 @@ gradleWrapperVersion=5.4 # Application appName=mod-agreements -appVersion=4.1.0 +appVersion=4.1.1 dockerTagSuffix= dockerRepo=folioci diff --git a/service/grails-app/domain/org/olf/kb/ErmResource.groovy b/service/grails-app/domain/org/olf/kb/ErmResource.groovy index a912e259c..3185b4499 100644 --- a/service/grails-app/domain/org/olf/kb/ErmResource.groovy +++ b/service/grails-app/domain/org/olf/kb/ErmResource.groovy @@ -71,7 +71,10 @@ public class ErmResource extends ErmTitleList implements MultiTenant 0) { + /* + * If sts.size is not zero, or the counts differ, + * then string templates have been created, deleted or updated + * so run refresh for all. + */ + if ( + currentStsCount != previousStsCount || + sts.size() > 0 + ) { // StringTemplates have changed, ignore more granular changes and just refresh everything generateTemplatedUrlsForErmResources(tenantId) } else { @@ -235,10 +255,13 @@ public class StringTemplatingService { } } - //One transaction for updating value with new refresh time + //One transaction for updating value with new refresh time and new count (count taken from beginning of refresh task) AppSetting.withNewTransaction { url_refresh_cursor.value = new_cursor_value url_refresh_cursor.save(failOnError: true) + + previous_sts_count.value = currentStsCount + previous_sts_count.save(failOnError: true) } } diff --git a/service/src/integration-test/groovy/org/olf/TenantAPISpec.groovy b/service/src/integration-test/groovy/org/olf/TenantAPISpec.groovy index 5487a26e8..74139cf24 100644 --- a/service/src/integration-test/groovy/org/olf/TenantAPISpec.groovy +++ b/service/src/integration-test/groovy/org/olf/TenantAPISpec.groovy @@ -10,7 +10,7 @@ import spock.util.concurrent.PollingConditions @Integration @Stepwise -class TenantAPISpec extends HttpSpec { +class TenantAPISpec extends BaseSpec { static final String tenantName = 'tenant_api_tests' static final Closure booleanResponder = { @@ -22,15 +22,6 @@ class TenantAPISpec extends HttpSpec { } } - def setupSpec() { - httpClientConfig = { - client.clientCustomizer { HttpURLConnection conn -> - conn.connectTimeout = 2000 - conn.readTimeout = 10000 // Need this for activating tenants - } - } - } - def setup() { setHeaders((OkapiHeaders.TENANT): tenantName) }