Lokal Profil has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390142 )

Change subject: Stop categorization job during database update
......................................................................

Stop categorization job during database update

This commits changes which exist on labs today.

Change-Id: I26784cd24b5ccd52202ca45f02f15ce4bbbfe990
---
M bin/categorize_images.sh
M bin/update_monuments.sh
2 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/42/390142/1

diff --git a/bin/categorize_images.sh b/bin/categorize_images.sh
index 342b437..884f3d1 100755
--- a/bin/categorize_images.sh
+++ b/bin/categorize_images.sh
@@ -5,6 +5,9 @@
 CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 . $CURRENT_DIR/defaults.sh
 
+# Use a virtual environment with our requirements
+source $VIRTUAL_ENV_PATH/bin/activate
+
 # Make sure we are in our homedir
 cd $HOME_DIR || exit
 
diff --git a/bin/update_monuments.sh b/bin/update_monuments.sh
index 2d96a9c..3a4af50 100755
--- a/bin/update_monuments.sh
+++ b/bin/update_monuments.sh
@@ -28,10 +28,16 @@
 echo_time "Full source database update..."
 $PYWIKIBOT_BIN $ERFGOED_PATH/update_database.py -fullupdate -log -skip_wd
 
+# stop categorization job as next stage locks the database
+jstop categorize_images
+
 # Update the all monuments table
 echo_time "Update monuments_all table..."
 $MYSQL_BIN -h $DB_SERVER $DATABASE < 
$ERFGOED_PATH/sql/fill_table_monuments_all.sql
 
+# restart the categorization job
+jsub -l release=trusty -mem 1000m -once -j y -o 
/data/project/heritage/logs/categorize_images.log -N categorize_images 
/data/project/heritage/bin/categorize_images.sh >> 
/data/project/heritage/logs/crontab.log
+
 ## Update the image table. Is now another job
 # echo_time "Update image table..."
 # PYWIKIBOT_BIN $ERFGOED_PATH/populate_image_table.py

-- 
To view, visit https://gerrit.wikimedia.org/r/390142
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26784cd24b5ccd52202ca45f02f15ce4bbbfe990
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to