Page MenuHomePhabricator

D10459.diff
No OneTemporary

D10459.diff

diff --git a/src/applications/drydock/blueprint/DrydockMinMaxBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockMinMaxBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockMinMaxBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockMinMaxBlueprintImplementation.php
@@ -5,7 +5,7 @@
public function canAllocateMoreResources(array $pool) {
$max_count = $this->getDetail('max-count');
- return count($pool) < $max_count;
+ return $max_count === null || count($pool) < $max_count;
}
protected function shouldAllocateLease(
@@ -24,7 +24,9 @@
// we allow.
$open_count = $context->getBlueprintOpenResourceCount();
if ($open_count < $this->getDetail('max-count')) {
- return false;
+ if ($this->getDetail('max-count') !== null) {
+ return false;
+ }
}
// Find the resource that has the least leases.
diff --git a/src/applications/drydock/blueprint/DrydockMinMaxExpiryBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockMinMaxExpiryBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockMinMaxExpiryBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockMinMaxExpiryBlueprintImplementation.php
@@ -6,8 +6,16 @@
public function canAllocateMoreResources(array $pool) {
$max_count = $this->getDetail('max-count');
+ if ($max_count === null) {
+ return true;
+ }
+
$expiry = $this->getDetail('expiry');
+ if ($expiry === null) {
+ return count($pool) < $max_count;
+ }
+
// Only count resources that haven't yet expired, so we can overallocate
// if another expired resource is about to be closed (but is still waiting
// on it's current resources to be released).

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 20, 6:53 AM (1 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712714
Default Alt Text
D10459.diff (1 KB)

Event Timeline