Skip to content

Commit 5647e3e

Browse files
MartinPeverelliMickaelDatadome
authored andcommitted
feature/M095M01A-29 fastly#23: [MAGENTO 2] Make sure we are not sending purges for empty surrogate keys
- Use array_filter to remove any `falsy` elements for surrogate keys array before purge - Return early if surrogate keys array is empty
1 parent 30fe97a commit 5647e3e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: Model/Api.php

+5
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ public function cleanUrl($url)
179179
*/
180180
public function cleanBySurrogateKey($keys)
181181
{
182+
$keys = array_filter($keys);
183+
if (empty($keys)) {
184+
return true;
185+
}
186+
182187
$type = 'clean by key on ';
183188
$uri = $this->_getApiServiceUri() . 'purge';
184189
$num = count($keys);

0 commit comments

Comments
 (0)