diff --git a/NEWS.md b/NEWS.md index c403ab30..85ecb405 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +## 7.0.9 2024-10-18 + * Fixed problem with concurrentJobsGlobal not actually reading from environment variable + ## 7.0.8 2024-09-09 * ERM-3321 Description can be too long for index, causing mod-agreements error when updating from 6.0.x to later versions or failure on saving agreements with a long description * Swap basic GIN indices for GIN indices with trigram operator where they're not already set. diff --git a/service/gradle.properties b/service/gradle.properties index b078fbe8..4cfe22de 100644 --- a/service/gradle.properties +++ b/service/gradle.properties @@ -4,7 +4,7 @@ gormVersion=8.0.3 # Application appName=mod-agreements -appVersion=7.0.8 +appVersion=7.0.9 dockerTagSuffix= dockerRepo=folioci diff --git a/service/grails-app/services/org/olf/general/jobs/JobRunnerService.groovy b/service/grails-app/services/org/olf/general/jobs/JobRunnerService.groovy index a44306ba..b004d139 100644 --- a/service/grails-app/services/org/olf/general/jobs/JobRunnerService.groovy +++ b/service/grails-app/services/org/olf/general/jobs/JobRunnerService.groovy @@ -88,13 +88,21 @@ order by pj.dateCreated @PostConstruct void init() { // Set up the Executor - if ( grailsApplication.config.concurrentJobsGlobal instanceof Integer && grailsApplication.config.concurrentJobsGlobal > 0 ) - CONCURRENT_JOBS_GLOBAL = grailsApplication.config.concurrentJobsGlobal; + try { + def concurrentJobsGlobalConfig = grailsApplication.config.getProperty('concurrentJobsGlobal', int); + if (concurrentJobsGlobalConfig > 0) { + CONCURRENT_JOBS_GLOBAL = concurrentJobsGlobalConfig; + } + } catch (Exception e) { + log.error("Failed to read concurrentJobsGlobal from config: ${e}") + } + log.info("Configured jobConcurrency: ${CONCURRENT_JOBS_GLOBAL}") // Base the number of small jobs executable on the limit imposed on the default runner. taskConcurrency = CONCURRENT_JOBS_GLOBAL * 2 - - // SO: This is not ideal. We don't want to limit jobs globally to 1 ideally. It should be + log.info("Configured taskConcurrency: ${taskConcurrency}") + + // SO: This is not ideal. We don't want to limit jobs globally to 1 ideally. It should be // 1 per tenant, but that will involve implementing custom handling for the queue and executor. // While we only have 1 tenant, this will suffice. executorSvc = new ThreadPoolExecutor( @@ -111,7 +119,7 @@ order by pj.dateCreated 5, TimeUnit.SECONDS, // Makes the above wait time in 'seconds' new LinkedBlockingQueue() // Blocking queue - ) + ) // Raise an event to say we are ready. notify('jobs:job_runner_ready')