Skip to content

Commit

Permalink
UHF-9937: Rename scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Dec 2, 2024
1 parent 7ab0445 commit 88f3096
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
19 changes: 0 additions & 19 deletions docker/openshift/crons/migrate-changed-job-listings.sh

This file was deleted.

30 changes: 30 additions & 0 deletions docker/openshift/crons/migrate-helbit-data.sh
Original file line number Diff line number Diff line change
@@ -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
25 changes: 7 additions & 18 deletions docker/openshift/crons/migrate-job-listings.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 88f3096

Please sign in to comment.