Skip to content

Commit

Permalink
Update Api.php
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Dec 7, 2019
1 parent 7a7f906 commit 03f8fa2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static function do_refresh() {
break;
}
try {
$result = self::build_request(
self::build_request(
'RefreshObjectCaches',
[
'ObjectPath' => $url,
Expand Down Expand Up @@ -141,6 +141,9 @@ public static function get_quota() {
'message' => sprintf( __( 'You can refresh %s files and %s directories today.', Config::identifier ),
$result['UrlRemain'], $result['DirRemain'] )
];

return $data;

} catch ( ClientException $e ) {
return [
'status' => 500,
Expand All @@ -152,7 +155,5 @@ public static function get_quota() {
'message' => sprintf( __( 'Fail to get quota, error message: %s', Config::identifier ), $e->getErrorMessage() )
];
}

return $data;
}
}

0 comments on commit 03f8fa2

Please sign in to comment.