Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Do not break on httpDeletion failed, but log an error
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 7, 2016
1 parent 531d4f5 commit 8f42869
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/plugins/core.cache/AbstractCacheDriver.php
Expand Up @@ -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
Expand All @@ -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)
]
Expand Down

0 comments on commit 8f42869

Please sign in to comment.