Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15410187
D10459.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10459.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D10459: Fix behaviour of max count on blueprints
Attached
Detach File
Event Timeline
Log In to Comment