X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fwatcheditem%2FWatchedItemStore.php;h=f0ded1f2112c2be00cea20b1172b10f53af74b24;hb=9c7f6734c397a954b8eaa5ec73876f2b4bf92afb;hp=d33b6ae303934bbc22d1a0d294dba0fbf31b7598;hpb=8699880aab6f666f902b8d8927325760adfe7c20;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/watcheditem/WatchedItemStore.php b/includes/watcheditem/WatchedItemStore.php index d33b6ae303..f0ded1f211 100644 --- a/includes/watcheditem/WatchedItemStore.php +++ b/includes/watcheditem/WatchedItemStore.php @@ -236,7 +236,6 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac * @param int $dbIndex DB_MASTER or DB_REPLICA * * @return IDatabase - * @throws MWException */ private function getConnectionRef( $dbIndex ) { return $this->loadBalancer->getConnectionRef( $dbIndex, [ 'watchlist' ] ); @@ -383,9 +382,8 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac /** * @param UserIdentity $user - * @param TitleValue[] $titles + * @param LinkTarget[] $titles * @return bool - * @throws MWException */ public function removeWatchBatchForUser( UserIdentity $user, array $titles ) { if ( $this->readOnlyMode->isReadOnly() ) { @@ -718,7 +716,6 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac * @since 1.27 * @param UserIdentity $user * @param LinkTarget $target - * @throws MWException */ public function addWatch( UserIdentity $user, LinkTarget $target ) { $this->addWatchBatchForUser( $user, [ $target ] ); @@ -729,7 +726,6 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac * @param UserIdentity $user * @param LinkTarget[] $targets * @return bool - * @throws MWException */ public function addWatchBatchForUser( UserIdentity $user, array $targets ) { if ( $this->readOnlyMode->isReadOnly() ) { @@ -790,7 +786,6 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac * @param UserIdentity $user * @param LinkTarget $target * @return bool - * @throws MWException */ public function removeWatch( UserIdentity $user, LinkTarget $target ) { return $this->removeWatchBatchForUser( $user, [ $target ] ); @@ -1035,18 +1030,18 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac if ( $seenTime > $value->get( $subKey ) ) { // Revision is newer than the last one seen $value->set( $subKey, $seenTime ); - $this->latestUpdateCache->set( $key, $value, IExpiringStore::TTL_PROC_LONG ); + $this->latestUpdateCache->set( $key, $value, BagOStuff::TTL_PROC_LONG ); } elseif ( $seenTime === false ) { // Revision does not exist $value->set( $subKey, wfTimestamp( TS_MW ) ); - $this->latestUpdateCache->set( $key, $value, IExpiringStore::TTL_PROC_LONG ); + $this->latestUpdateCache->set( $key, $value, BagOStuff::TTL_PROC_LONG ); } else { return false; // nothing to update } return $value; }, - IExpiringStore::TTL_HOUR + BagOStuff::TTL_HOUR ); // If the page is watched by the user (or may be watched), update the timestamp @@ -1076,7 +1071,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac return $this->latestUpdateCache->getWithSetCallback( $key, - IExpiringStore::TTL_PROC_LONG, + BagOStuff::TTL_PROC_LONG, function () use ( $key ) { return $this->stash->get( $key ) ?: null; }