Skip to content

Commit c00d933

Browse files
committed
Checking for the latest object count, not a possibly stale one.
1 parent 0888361 commit c00d933

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/OpenCloud/ObjectStore/Resource/Container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ public function delete($deleteObjects = false)
180180
public function deleteWithObjects($secondsToWait = null)
181181
{
182182
// If container is empty, just delete it
183-
$numObjects = $this->getObjectCount();
184-
if ($numObjects === 0) {
183+
$numObjects = (int) $this->retrieveMetadata()->getProperty('Object-Count');
184+
if (0 === $numObjects) {
185185
return $this->delete();
186186
}
187187
// If timeout ($secondsToWait) is not specified by caller,

0 commit comments

Comments
 (0)