Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14704326
D10377.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
D10377.diff
View Options
diff --git a/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php
@@ -128,7 +128,20 @@
DrydockResource $resource,
DrydockLease $lease) {
- // TODO: Remove leased directory
+ $cmd = $lease->getInterface('command');
+ $path = $lease->getAttribute('path');
+
+ try {
+ if ($resource->getAttribute('platform') !== 'windows') {
+ $cmd->execx('rm -rf %s', $path);
+ } else {
+ $cmd->execx('rm -Recurse -Force %s', $path);
+ }
+ } catch (Exception $ex) {
+ // We try to clean up, but sometimes files are locked or still in
+ // use (this is far more common on Windows). There's nothing we can
+ // do about this, so we ignore it.
+ }
}
protected function shouldCloseUnleasedResource(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 17, 2:24 AM (21 h, 8 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6997911
Default Alt Text
D10377.diff (1 KB)
Attached To
Mode
D10377: Clean up lease directories when lease is released
Attached
Detach File
Event Timeline
Log In to Comment