Fix: unlimited deployment size

This commit is contained in:
Matej Bačo 2025-05-22 17:25:47 +02:00
parent 4adea70684
commit b4f5af8461
3 changed files with 4 additions and 4 deletions

View file

@ -182,7 +182,7 @@ class Create extends Action
}
}
if (!$fileSizeValidator->isValid($fileSize)) { // Check if file size is exceeding allowed limit
if (!$fileSizeValidator->isValid($fileSize) && $functionSizeLimit !== 0) { // Check if file size is exceeding allowed limit
throw new Exception(Exception::STORAGE_INVALID_FILE_SIZE);
}

View file

@ -486,7 +486,7 @@ class Builds extends Action
$sizeLimit = (int) $plan['deploymentSize'] * 1000 * 1000;
}
if ($directorySize > $sizeLimit) {
if ($directorySize > $sizeLimit && $sizeLimit !== 0) {
throw new \Exception('Repository directory size should be less than ' . number_format($sizeLimit / (1000 * 1000), 2) . ' MBs.');
}
@ -816,7 +816,7 @@ class Builds extends Action
if (isset($plan['buildSize'])) {
$buildSizeLimit = $plan['buildSize'] * 1000 * 1000;
}
if ($response['size'] > $buildSizeLimit) {
if ($response['size'] > $buildSizeLimit && $buildSizeLimit !== 0) {
throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / (1000 * 1000), 2) . ' MBs.');
}

View file

@ -183,7 +183,7 @@ class Create extends Action
}
}
if (!$fileSizeValidator->isValid($fileSize)) { // Check if file size is exceeding allowed limit
if (!$fileSizeValidator->isValid($fileSize) && $siteSizeLimit !== 0) { // Check if file size is exceeding allowed limit
throw new Exception(Exception::STORAGE_INVALID_FILE_SIZE);
}