Changeset 7131
- Timestamp:
- 04/18/2018 10:11:44 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-site-cloner/wordcamp-site-cloner.php
r5456 r7131 14 14 15 15 const PRIME_SITES_CRON_ACTION = 'wcsc_prime_sites'; 16 const WORDCAMP_SITES_ TRANSIENT_KEY = 'wcsc_sites';16 const WORDCAMP_SITES_OPTION_KEY = 'wcsc_sites'; 17 17 18 18 /** … … 168 168 function sites_endpoint() { 169 169 $sites = array(); 170 $cached_sites = get_site_ transient( WORDCAMP_SITES_TRANSIENT_KEY);170 $cached_sites = get_site_option( WORDCAMP_SITES_OPTION_KEY, array() ); 171 171 172 172 if ( $cached_sites ) { … … 193 193 } 194 194 195 // Keep the cache longer than needed, just to be sure that it doesn't expire before the cron job runs again 196 // todo This shouldn't be a transient, it should just be a regular option. 197 // Transients aren't guaranteed to exist until they expire, so it could expire before the next cron runs 198 set_site_transient( WORDCAMP_SITES_TRANSIENT_KEY, get_wordcamp_sites(), DAY_IN_SECONDS * 2 ); 195 update_site_option( WORDCAMP_SITES_OPTION_KEY, get_wordcamp_sites() ); 199 196 } 200 197
Note: See TracChangeset
for help on using the changeset viewer.