Changeset 25467 for trunk/src/wp-admin/includes/class-wp-upgrader.php
- Timestamp:
- 09/17/2013 02:27:21 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r25447 r25467 1449 1449 1450 1450 $lock_name = 'auto_upgrader.lock'; 1451 if ( get_site_ transient( $lock_name ) ) {1451 if ( get_site_option( $lock_name ) ) { 1452 1452 // Test to see if it was set more than an hour ago, if so, cleanup. 1453 if ( true || get_site_transient( $lock_name ) < ( time() - HOUR_IN_SECONDS ) ) 1454 delete_site_transient( $lock_name ); 1455 else // Recent lock 1453 if ( get_site_option( $lock_name ) < ( time() - HOUR_IN_SECONDS ) ) 1454 delete_site_option( $lock_name ); 1455 else { // The process is already locked 1456 echo "There's a lock in place"; 1456 1457 return; 1458 } 1457 1459 } 1458 1460 // Lock upgrades for us for half an hour 1459 if ( ! set_site_transient( $lock_name, microtime( true ), HOUR_IN_SECONDS / 2 ) )1461 if ( ! add_site_option( $lock_name, microtime( true ), HOUR_IN_SECONDS / 2 ) ) 1460 1462 return; 1461 1463 … … 1493 1495 wp_update_plugins(); // Check for Plugin updates 1494 1496 1495 // TODO The core database upgrade has already cleared this transient..1496 delete_site_ transient( $lock_name );1497 // Clear the lock 1498 delete_site_option( $lock_name ); 1497 1499 1498 1500 }
Note: See TracChangeset
for help on using the changeset viewer.