Skip to content

Commit

Permalink
Merge pull request #569 from Opetushallitus/disable-ytl-syncall
Browse files Browse the repository at this point in the history
Lisätty mahdollisuus disabloida YTL-integraatio
  • Loading branch information
augustk authored Sep 28, 2023
2 parents 737f0c3 + 71501b8 commit a20a335
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down Expand Up @@ -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') }}
Expand Down
15 changes: 10 additions & 5 deletions src/main/scala/support/Integrations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit a20a335

Please sign in to comment.