1
0
mirror of https://github.com/beestat/app.git synced 2026-05-13 10:52:29 -04:00

Made SmartyStreets failures not throw errors for #271

I still need to address the business side of things, though. For now if my subscription runs out or SmartyStreets returns garbage beestat will ignore the error and comparisons just won't work properly. Any issue caused by this will auto-resolve as soon as possible since the API call will retry automatically.
This commit is contained in:
Jon Ziebell
2020-05-19 22:18:04 -04:00
parent 6aeceef172
commit 4d9e1e660a
2 changed files with 15 additions and 15 deletions
+5 -7
View File
@@ -75,13 +75,8 @@ class external_api extends cora\api {
curl_setopt($curl_handle, CURLINFO_HEADER_OUT, true);
}
$should_cache = (
$this::$cache === true &&
$this::should_cache($arguments) === true
);
// Check the cache
if ($should_cache === true) {
if ($this::$cache === true) {
$cache_key = $this->generate_cache_key($arguments);
$cache_entry = $this->get_cache_entry($cache_key);
} else {
@@ -116,7 +111,10 @@ class external_api extends cora\api {
$this->log_mysql($curl_response);
}
if($should_cache === true) {
if(
$this::$cache === true &&
$this::should_cache($arguments, $curl_response, $this->curl_info) === true
) {
$this->create_update_cache_entry($cache_key, $curl_response);
}