File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,16 +34,20 @@ public function render(string $icon): ?string
3434 return null ;
3535 }
3636
37+ $ fetched = false ;
3738 $ svg = $ this ->iconCache ->resolve (
3839 key: "icon- {$ collection }- {$ iconName }" ,
39- callback: fn () => $ this ->fetchSvg ($ collection , $ iconName ),
40+ callback: function () use ($ collection , $ iconName , &$ fetched ) {
41+ $ fetched = true ;
42+
43+ return $ this ->fetchSvg ($ collection , $ iconName );
44+ },
4045 expiresAt: $ this ->iconConfig ->expiresAfter ,
4146 );
4247
43- /** @var bool $failed */
44- $ failed = $ this ->iconCache ->get ("icon-failure- {$ collection }- {$ iconName }" );
45-
46- if ($ failed ) {
48+ // fetchSvg() returns null only on failure, and resolve() will have cached
49+ // that null — drop it so a retry can happen once the failure marker expires.
50+ if ($ fetched && $ svg === null ) {
4751 $ this ->iconCache ->delete ("icon- {$ collection }- {$ iconName }" );
4852 }
4953
You can’t perform that action at this time.
0 commit comments