Springle has submitted this change and it was merged.

Change subject: Update cached article count monthly to avoid social unrest
......................................................................


Update cached article count monthly to avoid social unrest

The link-based article count is now fast to update, as it doesn't
require page parsing as it used to until some years ago. However,
it's not instant, so it sometimes gets very out of sync. Then wrong
counts are corrected and users freak out as if Orson Welles had
announced an alien invasion at the radio.

We are sick of
* users making Reedy waste precious time to run the script manually,
* clueless discussions where we're asked to prove that no, there is
  no teapot in orbit around the sun.

Wikibooks is excluded because some subdomains use comma count which
is untested. Multilingual projects are excluded because nobody there
cares about article count and some are huge.

Depends on I061b1bd7 (d70cceb5), deployed on all wikis on 2014-12-17.

Bug: T68867
Change-Id: I13f866b565f665a00ec6ce61bb5073cf380bd0ff
---
A files/misc/scripts/update-article-count
M manifests/misc/maintenance.pp
2 files changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Springle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/files/misc/scripts/update-article-count 
b/files/misc/scripts/update-article-count
new file mode 100644
index 0000000..5998fd8
--- /dev/null
+++ b/files/misc/scripts/update-article-count
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+. /etc/profile.d/mediawiki.sh
+
+cd "$MEDIAWIKI_DEPLOYMENT_DIR/multiversion"
+# All language subdomains of content projects, unless they use comma count
+for set in wikinews wikipedia wikiquote wikisource wikiversity wikivoyage 
wiktionary; do
+       echo $set
+       /usr/local/bin/mwscriptwikiset updateArticleCount.php $set.dblist 
--update
+       echo
+       echo
+done
diff --git a/manifests/misc/maintenance.pp b/manifests/misc/maintenance.pp
index 248952b..a786f03 100644
--- a/manifests/misc/maintenance.pp
+++ b/manifests/misc/maintenance.pp
@@ -168,6 +168,25 @@
     }
 }
 
+class misc::maintenance::update_article_count( $ensure = present ) {
+    cron { 'update_article_count':
+        ensure   => $ensure,
+        command  => 'flock -n /var/lock/update-article-count 
/usr/local/bin/update-article-count > /var/log/mediawiki/updateArticleCount.log 
2>&1',
+        user     => 'apache',
+        monthday => 29,
+        hour     => 5,
+        minute   => 0,
+    }
+
+    file { '/usr/local/bin/update-article-count':
+        ensure => $ensure,
+        source => 'puppet:///files/misc/scripts/update-article-count',
+        owner  => 'apache',
+        group  => 'wikidev',
+        mode   => '0755',
+    }
+}
+
 class misc::maintenance::wikidata( $ensure = present ) {
     cron { 'wikibase-repo-prune2':
         ensure  => $ensure,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I13f866b565f665a00ec6ce61bb5073cf380bd0ff
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Nemo bis <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Springle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to