Skip to content

Commit

Permalink
Merge pull request #8879 from magento-performance/ACPT-1840
Browse files Browse the repository at this point in the history
ACPT-1840: Failures on S3 related WebAPI test with Application Server
  • Loading branch information
andimov authored May 8, 2024
2 parents 995a05c + 246abea commit b0c49b2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
19 changes: 15 additions & 4 deletions app/code/Magento/Catalog/Model/Category/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
use Magento\Framework\Filesystem\Directory\ReadInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Filesystem\ExtendedDriverInterface;
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
use Magento\Store\Model\StoreManagerInterface;

/**
* Class FileInfo
*
* Provides information about requested file
*/
class FileInfo
class FileInfo implements ResetAfterRequestInterface
{
/**
* Path in /pub/media directory
Expand All @@ -31,12 +32,12 @@ class FileInfo
/**
* @var Filesystem
*/
private $filesystem;
private readonly Filesystem $filesystem;

/**
* @var Mime
*/
private $mime;
private readonly Mime $mime;

/**
* @var WriteInterface
Expand All @@ -56,7 +57,7 @@ class FileInfo
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
private $storeManager;
private readonly StoreManagerInterface $storeManager;

/**
* @param Filesystem $filesystem
Expand All @@ -73,6 +74,16 @@ public function __construct(
$this->storeManager = $storeManager;
}

/**
* @inheritDoc
*/
public function _resetState(): void
{
$this->mediaDirectory = null;
$this->baseDirectory = null;
$this->pubDirectory = null;
}

/**
* Get WriteInterface instance
*
Expand Down
12 changes: 11 additions & 1 deletion app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
namespace Magento\RemoteStorage\Driver\Adapter\Cache;

use Magento\Framework\App\CacheInterface as MagentoCacheInterface;
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\RemoteStorage\Driver\Adapter\PathUtil;

/**
* Generic cache implementation for filesystem storage.
*/
class Generic implements CacheInterface
class Generic implements CacheInterface, ResetAfterRequestInterface
{
/**
* @var array
Expand Down Expand Up @@ -66,6 +67,15 @@ public function __construct(
$this->pathUtil = $pathUtil;
}

/**
* @inheritDoc
*/
public function _resetState(): void
{
$this->cacheData = [];
$this->cachePathPurgeQueue = [];
}

/**
* @inheritdoc
*/
Expand Down

0 comments on commit b0c49b2

Please sign in to comment.