Skip to content

Commit

Permalink
Merge pull request #1876 from alissn/FixFileCache
Browse files Browse the repository at this point in the history
  • Loading branch information
dcblogdev authored Jun 30, 2024
2 parents edbcef6 + d7e2359 commit ccbe1c2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getContents()
*/
public function decodeContents()
{
$attributes = json_decode($this->getContents(), 1);
$attributes = $this->filesystem->json($this->getPath());

// any JSON parsing errors should throw an exception
if (json_last_error() > 0) {
Expand All @@ -136,13 +136,7 @@ public function decodeContents()
*/
public function getAttributes()
{
if (config('modules.cache.enabled') === false) {
return $this->decodeContents();
}

return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function () {
return $this->decodeContents();
});
return $this->decodeContents();
}

/**
Expand Down

0 comments on commit ccbe1c2

Please sign in to comment.