From 71501b8115d5196e22e52c5634f6dd29bdc476da Mon Sep 17 00:00:00 2001 From: August Kilponen Date: Wed, 27 Sep 2023 17:02:16 +0300 Subject: [PATCH] =?UTF-8?q?Lis=C3=A4tty=20mahdollisuus=20disabloida=20YTL-?= =?UTF-8?q?integraatio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- .../suoritusrekisteri.properties.template | 3 ++- src/main/scala/support/Integrations.scala | 15 ++++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 0243c8af9d..f958fb274e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "scripts": { - "build": "npm install -s && bower install && coffee --join target/classes/webapp/compiled/scripts.js --compile src/main/resources/coffee/*.coffee", - "watch": "npm install -s && bower install && coffee --watch --join target/classes/webapp/compiled/scripts.js --compile src/main/resources/coffee/*.coffee" + "build": "npm ci -s && bower install && coffee --join target/classes/webapp/compiled/scripts.js --compile src/main/resources/coffee/*.coffee", + "watch": "npm ci -s && bower install && coffee --watch --join target/classes/webapp/compiled/scripts.js --compile src/main/resources/coffee/*.coffee" }, "name": "hakurekisteri", "description": "hakurekisteri", diff --git a/src/main/resources/oph-configuration/suoritusrekisteri.properties.template b/src/main/resources/oph-configuration/suoritusrekisteri.properties.template index 3031827473..82e94bb3c0 100644 --- a/src/main/resources/oph-configuration/suoritusrekisteri.properties.template +++ b/src/main/resources/oph-configuration/suoritusrekisteri.properties.template @@ -1,6 +1,6 @@ # # TÄHÄN TIEDOSTOON EI SAA TALLENTAA YMPÄRISTÖKOHTAISIA ARVOJA MUUTOIN KUIN MUUTTUJINA!!! -# +# # Tämä tiedosto toimii pohjana oph-configuration/common.properties tiedostolle, # joka asettaa tomcatin ympäristökohtaiset arvot. # @@ -151,6 +151,7 @@ ytl.http.host.fetchone={{suoritusrekisteri_ytl_http_host}}/api/oph-transfer/stud ytl.http.host.status={{suoritusrekisteri_ytl_http_host}}/api/oph-transfer/status/$1 ytl.http.username={{suoritusrekisteri_ytl_http_username}} ytl.http.password={{suoritusrekisteri_ytl_http_password}} +ytl.http.syncAllEnabled={{ suoritusrekisteri_ytl_http_syncallenabled | default('true') }} #ytl.http.syncAllCronJob=0 0/5 01-02 * * ? ytl.http.syncAllCronJob={{ suoritusrekisteri_ytl_http_syncallcronjob | default('0 0/5 01-02 * * ?') }} ytl.http.chunksize={{ suoritusrekisteri_ytl_http_chunksize | default('50000') }} diff --git a/src/main/scala/support/Integrations.scala b/src/main/scala/support/Integrations.scala index f5fd2d5358..fe450b65ad 100644 --- a/src/main/scala/support/Integrations.scala +++ b/src/main/scala/support/Integrations.scala @@ -544,13 +544,18 @@ class BaseIntegrations(rekisterit: Registers, system: ActorSystem, config: Confi quartzScheduler.start() } + val ytlSyncAllEnabled = OphUrlProperties.getProperty("ytl.http.syncAllEnabled").toBoolean val syncAllCronExpression = OphUrlProperties.getProperty("ytl.http.syncAllCronJob") val rerunSync = YtlRerunPolicy.rerunPolicy(syncAllCronExpression, ytlIntegration) - quartzScheduler.scheduleJob( - lambdaJob(rerunSync), - newTrigger().startNow().withSchedule(cronSchedule(syncAllCronExpression)).build() - ); - logger.info(s"Scheduled syncAll jobs (cron expression=$syncAllCronExpression)") + if (ytlSyncAllEnabled) { + quartzScheduler.scheduleJob( + lambdaJob(rerunSync), + newTrigger().startNow().withSchedule(cronSchedule(syncAllCronExpression)).build() + ) + logger.info(s"Scheduled Ytl syncAll jobs (cron expression=$syncAllCronExpression)") + } else { + logger.info(s"Not scheduled syncAll jobs because it is not enabled") + } if (KoskiUtil.updateKkHaut || KoskiUtil.updateToisenAsteenHaut) { logger.info(