Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Always cache the check_api_key_stats API result #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions lib/class-sendgrid-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,10 +1162,8 @@ public static function check_api_key_stats( $apikey, $clear_cache = false )
$check_scopes = Sendgrid_Tools::check_api_key_scopes( $apikey, $required_scopes );

// set cache
if ( $check_scopes ) {
self::set_transient_sendgrid( self::CHECK_API_KEY_STATS_CACHE_KEY, self::VALID_CREDENTIALS_STATUS, 2 * 60 * 60 );
}

self::set_transient_sendgrid( self::CHECK_API_KEY_STATS_CACHE_KEY, self::VALID_CREDENTIALS_STATUS, 2 * HOUR_IN_SECONDS );

return $check_scopes;
}

Expand Down