diff --git a/classes/models/FrmSalesApi.php b/classes/models/FrmSalesApi.php index 0951028a10..dd7e18d6e9 100644 --- a/classes/models/FrmSalesApi.php +++ b/classes/models/FrmSalesApi.php @@ -69,6 +69,22 @@ protected function api_url() { return 'https://plapi.formidableforms.com/sales/'; } + /** + * If the last check was a rate limit, we'll need to check again sooner. + * + * @since x.x + * + * @param array $addons + * + * @return string + */ + protected function get_cache_timeout( $addons ) { + if ( isset( $addons['response_code'] ) && 429 === $addons['response_code'] ) { + return '+1 hour'; + } + return $this->cache_timeout; + } + /** * @since 6.17 *