Skip to content

Commit 83a1c23

Browse files
committed
MC-6273: Mysql url_rewrite select make on product view page 170+ times per request
- fixed integration tests
1 parent a3f84b5 commit 83a1c23

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Form/ContainerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testGetFormHtml()
3030
$expectedHtml = '<b>html</b>';
3131
$this->assertNotEquals($expectedHtml, $block->getFormHtml());
3232
$form->setText($expectedHtml);
33-
$this->assertEquals('', $block->getFormHtml());
33+
$this->assertEquals($expectedHtml, $block->getFormHtml());
3434
}
3535

3636
public function testPseudoConstruct()

lib/internal/Magento/Framework/Lock/Backend/Cache.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,31 @@ public function __construct(FrontendInterface $cache)
3737
*/
3838
public function lock(string $name, int $timeout = -1): bool
3939
{
40-
return $this->cache->save('1', self::LOCK_PREFIX . $name, [], $timeout);
40+
return $this->cache->save('1', $this->getIdentifier($name), [], $timeout);
4141
}
4242

4343
/**
4444
* @inheritdoc
4545
*/
4646
public function unlock(string $name): bool
4747
{
48-
return $this->cache->remove(self::LOCK_PREFIX . $name);
48+
return $this->cache->remove($this->getIdentifier($name));
4949
}
5050

5151
/**
5252
* @inheritdoc
5353
*/
5454
public function isLocked(string $name): bool
5555
{
56-
return (bool)$this->cache->test(self::LOCK_PREFIX . $name);
56+
return (bool)$this->cache->test($this->getIdentifier($name));
57+
}
58+
59+
/**
60+
* @param string $name
61+
* @return string
62+
*/
63+
private function getIdentifier(string $name): string
64+
{
65+
return self::LOCK_PREFIX . $name;
5766
}
5867
}

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ public function toHtml()
686686
]);
687687
$html = $transportObject->getHtml();
688688

689-
return (string)$html;
689+
return $html;
690690
}
691691

692692
/**

0 commit comments

Comments
 (0)