File tree Expand file tree Collapse file tree 2 files changed +30
-6
lines changed
Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 11includes:
2+ - vendor/larastan/larastan/extension.neon
23 - phpstan-baseline.neon
34
45parameters:
@@ -9,4 +10,3 @@ parameters:
910 tmpDir: build/phpstan
1011 checkOctaneCompatibility: true
1112 checkModelProperties: true
12-
Original file line number Diff line number Diff line change @@ -73,11 +73,16 @@ public function getLatestTag(?string $repository = null): string
7373 $ repository = $ repository ?? $ this ->repository ;
7474 $ cacheKey = "filament-easy-footer.github. {$ repository }.latest-tag " ;
7575
76- return Cache::remember (
77- $ cacheKey ,
78- $ this ->cacheTtl ,
79- fn () => $ this ->fetchLatestTag ($ repository ) ?? $ this ->defaultVersion
80- );
76+ $ cachedTag = $ this ->getCacheWithoutTags ($ cacheKey );
77+ if ($ cachedTag !== null ) {
78+ return $ cachedTag ;
79+ }
80+
81+ $ tag = $ this ->fetchLatestTag ($ repository ) ?? $ this ->defaultVersion ;
82+
83+ $ this ->setCacheWithoutTags ($ cacheKey , $ tag , $ this ->cacheTtl );
84+
85+ return $ tag ;
8186 }
8287
8388 protected function fetchLatestTag (string $ repository ): ?string
@@ -103,4 +108,23 @@ protected function fetchLatestTag(string $repository): ?string
103108
104109 return null ;
105110 }
111+
112+ protected function getCacheWithoutTags (string $ key )
113+ {
114+ try {
115+ return Cache::store (config ('cache.default ' ))->get ($ key );
116+ } catch (\Exception $ e ) {
117+ report ($ e );
118+ return null ;
119+ }
120+ }
121+
122+ protected function setCacheWithoutTags (string $ key , $ value , int $ ttl ): void
123+ {
124+ try {
125+ Cache::store (config ('cache.default ' ))->put ($ key , $ value , $ ttl );
126+ } catch (\Exception $ e ) {
127+ report ($ e );
128+ }
129+ }
106130}
You can’t perform that action at this time.
0 commit comments