r58189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58188‎ | r58189 | r58190 >
Date:10:01, 27 October 2009
Author:midom
Status:ok
Tags:
Comment:
MFT: don't lock around conversion table memcached update
Modified paths:
  • /branches/wmf-deployment/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/languages/LanguageConverter.php
@@ -640,33 +640,6 @@
641641 }
642642
643643 /**
644 - * a write lock to the cache
645 - *
646 - * @private
647 - */
648 - function lockCache() {
649 - global $wgMemc;
650 - $success = false;
651 - for($i=0; $i<30; $i++) {
652 - if($success = $wgMemc->add($this->mCacheKey . "lock", 1, 10))
653 - break;
654 - sleep(1);
655 - }
656 - return $success;
657 - }
658 -
659 - /**
660 - * unlock cache
661 - *
662 - * @private
663 - */
664 - function unlockCache() {
665 - global $wgMemc;
666 - $wgMemc->delete($this->mCacheKey . "lock");
667 - }
668 -
669 -
670 - /**
671644 * Load default conversion tables
672645 * This method must be implemented in derived class
673646 *
@@ -706,11 +679,8 @@
707680
708681 $this->postLoadTables();
709682 $this->mTables[self::CACHE_VERSION_KEY] = true;
710 -
711 - if($this->lockCache()) {
712 - $wgMemc->set($this->mCacheKey, $this->mTables, 43200);
713 - $this->unlockCache();
714 - }
 683+
 684+ $wgMemc->set($this->mCacheKey, $this->mTables, 43200);
715685 wfProfileOut( __METHOD__.'-recache' );
716686 }
717687 wfProfileOut( __METHOD__ );

Status & tagging log