Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions classes/models/FrmSalesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Loading