Permalink
Browse files

Do not break on httpDeletion failed, but log an error

  • Loading branch information...
1 parent 531d4f5 commit 8f42869744f45eb0b35e1ff5de3488a8812d7e3b @cdujeu cdujeu committed Oct 7, 2016
Showing with 5 additions and 2 deletions.
  1. +5 −2 core/src/plugins/core.cache/AbstractCacheDriver.php
@@ -385,7 +385,8 @@ protected function getHttpClient(){
if(!isSet($this->httpClient)){
$baseUrl = ApplicationState::detectServerURL(true);
if(empty($baseUrl)){
- throw new PydioException("Server URL does not seem to be configured, CLI cannot trigger cache deletion commands");
+ $this->logError("Http Deletion", "Server URL does not seem to be configured, CLI cannot trigger cache deletion commands!");
+ return null;
}
$this->httpClient = new Client([
'base_url' => $baseUrl
@@ -397,7 +398,9 @@ protected function getHttpClient(){
public function __destruct()
{
if(count($this->httpDeletion)){
- $this->getHttpClient()->post('/?get_action=clear_cache_key', [
+ $client = $this->getHttpClient();
+ if(empty($client)) return;
+ $client->post('/?get_action=clear_cache_key', [
'body' => [
'data' => json_encode($this->httpDeletion)
]

0 comments on commit 8f42869

Please sign in to comment.