Skip to content

Commit

Permalink
No caching in workers
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Aug 25, 2024
1 parent f9bc8d9 commit 4066656
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ function filesystem(?FilesystemDriver $driver = null): Filesystem
return $map[$loop];
}

$driver = new StatusCachingFilesystemDriver(createDefaultDriver());
$driver = createDefaultDriver();

if (!\defined("AMP_WORKER")) { // Prevent caching in workers, cache in parent instead.
$driver = new StatusCachingFilesystemDriver($driver);
}
}

return $map[$loop] = new Filesystem($driver);
Expand Down

0 comments on commit 4066656

Please sign in to comment.