protected function removeDBInstance(DBInstanceData $dbi)
{
$this->assertInstanceOf($this->getRdsClassName('DataType\\DBInstanceData'), $dbi);
if ($dbi->dBInstanceStatus != DBInstanceData::STATUS_DELETING) {
$dbi = $dbi->delete(true);
}
$timeout = 0;
while ($dbi->dBInstanceStatus == DBInstanceData::STATUS_DELETING && ($timeout += static::SLEEP_TIMEOUT) < static::SLEEP_TIME) {
sleep(static::SLEEP_TIMEOUT);
try {
$dbi = $dbi->refresh();
} catch (ClientException $e) {
if ($e->getErrorData()->getCode() == ErrorData::ERR_DB_INSTANCE_NOT_FOUND) {
break;
}
throw $e;
}
}
}