Merge pull request #1624 from woocommerce/PCP-1823-transient-time

Do not use transient expiration longer than month to support memcached
This commit is contained in:
Emili Castells 2023-09-07 14:10:39 +02:00 committed by GitHub
commit c0058f758f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -135,7 +135,7 @@ class BillingAgreementsEndpoint {
); );
} finally { } finally {
$this->is_request_logging_enabled = true; $this->is_request_logging_enabled = true;
set_transient( 'ppcp_reference_transaction_enabled', true, 3 * MONTH_IN_SECONDS ); set_transient( 'ppcp_reference_transaction_enabled', true, MONTH_IN_SECONDS );
} }
return true; return true;

View file

@ -98,7 +98,7 @@ class PPECHelper {
set_transient( set_transient(
'ppcp_has_ppec_subscriptions', 'ppcp_has_ppec_subscriptions',
! empty( $result ) ? 'true' : 'false', ! empty( $result ) ? 'true' : 'false',
3 * MONTH_IN_SECONDS MONTH_IN_SECONDS
); );
return ! empty( $result ); return ! empty( $result );

View file

@ -64,7 +64,7 @@ class OnboardingUrl {
* *
* @var int * @var int
*/ */
private $cache_ttl = 3 * MONTH_IN_SECONDS; private $cache_ttl = MONTH_IN_SECONDS;
/** /**
* The TTL for the previous token cache. * The TTL for the previous token cache.

View file

@ -135,12 +135,12 @@ class DCCProductStatus {
$this->settings->set( 'products_dcc_enabled', true ); $this->settings->set( 'products_dcc_enabled', true );
$this->settings->persist(); $this->settings->persist();
$this->current_status_cache = true; $this->current_status_cache = true;
$this->cache->set( self::DCC_STATUS_CACHE_KEY, 'true', 3 * MONTH_IN_SECONDS ); $this->cache->set( self::DCC_STATUS_CACHE_KEY, 'true', MONTH_IN_SECONDS );
return true; return true;
} }
} }
$expiration = 3 * MONTH_IN_SECONDS; $expiration = MONTH_IN_SECONDS;
if ( $this->dcc_applies->for_country_currency() ) { if ( $this->dcc_applies->for_country_currency() ) {
$expiration = 3 * HOUR_IN_SECONDS; $expiration = 3 * HOUR_IN_SECONDS;
} }

View file

@ -127,11 +127,11 @@ class PayUponInvoiceProductStatus {
$this->settings->set( 'products_pui_enabled', true ); $this->settings->set( 'products_pui_enabled', true );
$this->settings->persist(); $this->settings->persist();
$this->current_status_cache = true; $this->current_status_cache = true;
$this->cache->set( self::PUI_STATUS_CACHE_KEY, 'true', 3 * MONTH_IN_SECONDS ); $this->cache->set( self::PUI_STATUS_CACHE_KEY, 'true', MONTH_IN_SECONDS );
return true; return true;
} }
} }
$this->cache->set( self::PUI_STATUS_CACHE_KEY, 'false', 3 * MONTH_IN_SECONDS ); $this->cache->set( self::PUI_STATUS_CACHE_KEY, 'false', MONTH_IN_SECONDS );
$this->current_status_cache = false; $this->current_status_cache = false;
return false; return false;