Gehel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/404315 )

Change subject: wdqs: simplify logging of categories reload
......................................................................


wdqs: simplify logging of categories reload

The reload of categories was logged to multiple files, including one that
was timestamped. This generates unnecessary complexity.

My guess is that this multiple logging was done to also log manual reload
of categories, which was usefull during a testing phase where categories
were reloaded manually.

Change-Id: I58199e4c0d4397d2da8308187fb6b870fecf5f80
---
M modules/wdqs/files/cron/reloadCategories.sh
M modules/wdqs/manifests/gui.pp
2 files changed, 12 insertions(+), 17 deletions(-)

Approvals:
  Smalyshev: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Gehel: Looks good to me, approved



diff --git a/modules/wdqs/files/cron/reloadCategories.sh 
b/modules/wdqs/files/cron/reloadCategories.sh
index 2710a19..2f9dfe9 100755
--- a/modules/wdqs/files/cron/reloadCategories.sh
+++ b/modules/wdqs/files/cron/reloadCategories.sh
@@ -4,12 +4,17 @@
 # sudo systemctl reload nginx
 . /usr/local/bin/cronUtils.sh
 
+echo "$(date --iso-8601=seconds) starting categories reload"
+
 newNamespace="categories${today}"
 # Drop old dumps
 rm -f ${DATA_DIR}/*-categories.ttl.gz
-cd $DEPLOY_DIR
+cd ${DEPLOY_DIR}
 # Create new namespace
-bash createNamespace.sh $newNamespace || exit 1
+bash createNamespace.sh ${newNamespace} || exit 1
 # Load the data
-bash forAllCategoryWikis.sh loadCategoryDump.sh $newNamespace >> 
"${LOG_DIR}/${newNamespace}.log"
-replaceNamespace categories $newNamespace
+echo "loading categories in ${newNamespace}"
+bash forAllCategoryWikis.sh loadCategoryDump.sh $newNamespace
+replaceNamespace categories ${newNamespace}
+
+echo "$(date --iso-8601=seconds) categories reload done"
diff --git a/modules/wdqs/manifests/gui.pp b/modules/wdqs/manifests/gui.pp
index d056705..7ff6dfa 100644
--- a/modules/wdqs/manifests/gui.pp
+++ b/modules/wdqs/manifests/gui.pp
@@ -83,7 +83,7 @@
         mode   => '0755',
     }
 
-    $cron_log = "${log_dir}/reloadCategories.log"
+    $reload_categories_log = "${log_dir}/reloadCategories.log"
     # the reload-categories cron needs to reload nginx once the categories are 
up to date
     sudo::user { "${username}-reload-nginx":
       ensure     => present,
@@ -96,7 +96,7 @@
     # do not want them to be too far from one another.
     cron { 'reload-categories':
         ensure  => present,
-        command => "/usr/local/bin/reloadCategories.sh >> ${cron_log}",
+        command => "/usr/local/bin/reloadCategories.sh >> 
${reload_categories_log}",
         user    => $username,
         weekday => 1,
         minute  => fqdn_rand(60),
@@ -114,7 +114,7 @@
 
     logrotate::rule { 'wdqs-reload-categories':
         ensure       => present,
-        file_glob    => $cron_log,
+        file_glob    => $reload_categories_log,
         frequency    => 'monthly',
         missing_ok   => true,
         not_if_empty => true,
@@ -134,14 +134,4 @@
         su           => "${username} wikidev",
     }
 
-    # Remove categories*.log files after 30 days.
-    logrotate::rule { 'wdqs-categories-logs':
-        ensure       => present,
-        file_glob    => "${log_dir}/categories*.log",
-        missing_ok   => true,
-        not_if_empty => true,
-        rotate       => 0,
-        max_age      => 30,
-        su           => "${username} wikidev",
-    }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I58199e4c0d4397d2da8308187fb6b870fecf5f80
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to