release_lock example

array(
                    'signature_failure_code' => $download->get_error_code(),
                    'signature_failure_data' => $download->get_error_data(),
                )
            );

            // Pretend this error didn't happen.             $download = $download->get_error_data( 'softfail-filename' );
        }

        if ( is_wp_error( $download ) ) {
            WP_Upgrader::release_lock( 'core_updater' );
            return $download;
        }

        $working_dir = $this->unpack_package( $download );
        if ( is_wp_error( $working_dir ) ) {
            WP_Upgrader::release_lock( 'core_updater' );
            return $working_dir;
        }

        // Copy update-core.php from the new version into place.         if ( ! $wp_filesystem->copy( $working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true ) ) {
            
/** * Fires after all automatic updates have run. * * @since 3.8.0 * * @param array $update_results The results of all attempted updates. */
            do_action( 'automatic_updates_complete', $this->update_results );
        }

        WP_Upgrader::release_lock( 'auto_updater' );
    }

    /** * Checks whether to send an email and avoid processing future updates after * attempting a core update. * * @since 3.7.0 * * @param object $update_result The result of the core update. Includes the update offer and result. */
    protected function after_core_update( $update_result ) {
        
// If a lock couldn't be created, and there isn't a lock, bail.             if ( ! $lock_result ) {
                return false;
            }

            // Check to see if the lock is still valid. If it is, bail.             if ( $lock_result > ( time() - $release_timeout ) ) {
                return false;
            }

            // There must exist an expired lock, clear it and re-gain it.             WP_Upgrader::release_lock( $lock_name );

            return WP_Upgrader::create_lock( $lock_name$release_timeout );
        }

        // Update the lock, as by this point we've definitely got a lock, just need to fire the actions.         update_option( $lock_optiontime() );

        return true;
    }

    /** * Releases an upgrader lock. * * @since 4.5.0 * * @see WP_Upgrader::create_lock() * * @param string $lock_name The name of this unique lock. * @return bool True if the lock was successfully released. False on failure. */
Home | Imprint | This part of the site doesn't use cookies.