From 88f3096d6c6d447a1e824ab928baa6481e756e25 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Mon, 2 Dec 2024 15:15:29 +0200 Subject: [PATCH] UHF-9937: Rename scripts --- .../crons/migrate-changed-job-listings.sh | 19 ------------ docker/openshift/crons/migrate-helbit-data.sh | 30 +++++++++++++++++++ .../openshift/crons/migrate-job-listings.sh | 25 +++++----------- 3 files changed, 37 insertions(+), 37 deletions(-) delete mode 100644 docker/openshift/crons/migrate-changed-job-listings.sh create mode 100644 docker/openshift/crons/migrate-helbit-data.sh diff --git a/docker/openshift/crons/migrate-changed-job-listings.sh b/docker/openshift/crons/migrate-changed-job-listings.sh deleted file mode 100644 index 12f1b580..00000000 --- a/docker/openshift/crons/migrate-changed-job-listings.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -migrations=( - "helfi_rekry_jobs:all" -) - -echo "Starting job listing:changed migrations: $(date)" -while true -do - echo "Running job listing:changed migrations: $(date)" - - for migration in "${migrations[@]}"; do - # Allow migrations to be run every 10 minutes, reset stuck migrations every 30 minutes. - drush migrate:import "$migration" --reset-threshold 1800 --interval 600 --no-progress - done - - # Sleep for 15 minutes. - sleep 900 -done diff --git a/docker/openshift/crons/migrate-helbit-data.sh b/docker/openshift/crons/migrate-helbit-data.sh new file mode 100644 index 00000000..152b36fa --- /dev/null +++ b/docker/openshift/crons/migrate-helbit-data.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +migrations=( + "helfi_rekry_images:all" + "helfi_rekry_videos:all" + "helfi_rekry_task_areas:fi" + "helfi_rekry_task_areas:sv" + "helfi_rekry_task_areas:en" + "helfi_rekry_organizations:fi" + "helfi_rekry_organizations:sv" + "helfi_rekry_organizations:en" + "helfi_rekry_employments:all" + "helfi_rekry_employment_types:all" +) + +echo "Starting job listing migrations: $(date)" +while true +do + echo "Running job listing migrations: $(date)" + + for migration in "${migrations[@]}"; do + # Allow migrations to be run every 1.5 hours, reset stuck migrations every 12 hours. + drush migrate:import "$migration" --reset-threshold 43200 --interval 5400 --no-progress + done + + drush helfi-rekry-content:clean-expired-listings + + # Sleep for 3 hours. + sleep 10800 +done diff --git a/docker/openshift/crons/migrate-job-listings.sh b/docker/openshift/crons/migrate-job-listings.sh index 152b36fa..12f1b580 100644 --- a/docker/openshift/crons/migrate-job-listings.sh +++ b/docker/openshift/crons/migrate-job-listings.sh @@ -1,30 +1,19 @@ #!/bin/bash migrations=( - "helfi_rekry_images:all" - "helfi_rekry_videos:all" - "helfi_rekry_task_areas:fi" - "helfi_rekry_task_areas:sv" - "helfi_rekry_task_areas:en" - "helfi_rekry_organizations:fi" - "helfi_rekry_organizations:sv" - "helfi_rekry_organizations:en" - "helfi_rekry_employments:all" - "helfi_rekry_employment_types:all" + "helfi_rekry_jobs:all" ) -echo "Starting job listing migrations: $(date)" +echo "Starting job listing:changed migrations: $(date)" while true do - echo "Running job listing migrations: $(date)" + echo "Running job listing:changed migrations: $(date)" for migration in "${migrations[@]}"; do - # Allow migrations to be run every 1.5 hours, reset stuck migrations every 12 hours. - drush migrate:import "$migration" --reset-threshold 43200 --interval 5400 --no-progress + # Allow migrations to be run every 10 minutes, reset stuck migrations every 30 minutes. + drush migrate:import "$migration" --reset-threshold 1800 --interval 600 --no-progress done - drush helfi-rekry-content:clean-expired-listings - - # Sleep for 3 hours. - sleep 10800 + # Sleep for 15 minutes. + sleep 900 done