@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Handle errors in reading cache

Summary: I've stored `PhutilSafeHTML` instance to cache on devbox and then wasn't able to read it in production.

Test Plan: Displayed revision with unreadable cache, saw error in error log but not fatal.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4520

vrana dd5da0fe 38020070

+9 -9
+9 -9
src/infrastructure/markup/PhabricatorMarkupEngine.php
··· 188 188 } 189 189 190 190 if ($use_cache) { 191 - $blocks = id(new PhabricatorMarkupCache())->loadAllWhere( 192 - 'cacheKey IN (%Ls)', 193 - array_keys($use_cache)); 194 - $blocks = mpull($blocks, null, 'getCacheKey'); 191 + try { 192 + $blocks = id(new PhabricatorMarkupCache())->loadAllWhere( 193 + 'cacheKey IN (%Ls)', 194 + array_keys($use_cache)); 195 + $blocks = mpull($blocks, null, 'getCacheKey'); 196 + } catch (Exception $ex) { 197 + phlog($ex); 198 + } 195 199 } 196 200 197 201 foreach ($objects as $key => $info) { ··· 220 224 if (isset($use_cache[$key])) { 221 225 // This is just filling a cache and always safe, even on a read pathway. 222 226 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 223 - try { 224 - $blocks[$key]->save(); 225 - } catch (AphrontQueryDuplicateKeyException $ex) { 226 - // Ignore this, we just raced to write the cache. 227 - } 227 + $blocks[$key]->replace(); 228 228 unset($unguarded); 229 229 } 230 230 }