Skip to content

Commit

Permalink
fix(CachingMappingFactory): Skip the cache if in debug mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Jan 14, 2024
1 parent 8ff3a84 commit 85898fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* fix: Remove cache file & regenerate it if it is corrupt.
* fix: `NullTransformer` bug.
* fix(`CachingMappingFactory`): Cache result in memory.
* fix(`CachingMappingFactory`): Skip the cache if in debug mode.

## 0.5.8

Expand Down
4 changes: 4 additions & 0 deletions src/Mapping/CachingMappingFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public function getMapping(): Mapping
return $this->mapping;
}

if ($this->kernel->isDebug()) {
return $this->mapping = $this->warmUpAndGetMapping();
}

if (!file_exists($this->getCacheFilePath())) {
return $this->mapping = $this->warmUpAndGetMapping();
}
Expand Down

0 comments on commit 85898fa

Please sign in to comment.