• Resolved Jory Hogeveen

    (@keraweb)


    Good day! Please forward the following to your dev team:

    The CRON events of WP Fusion (pro) is triggering wp_die() to stop the event, this is incorrect as it also prevents the other queued CRON events from running.
    A CRON event should never kill the process unless there is an actual execution error (with error message).

    See WPF_Background_Process::maybe_handle()

    public function maybe_handle() {

    // Don't lock up other requests while processing
    session_write_close();

    if ( $this->is_process_running() ) {
    // Background process already running.
    wp_die();
    }

    if ( $this->is_queue_empty() ) {
    // No data to process.
    wp_die();
    }

    $this->handle();

    wp_die();
    }

    Please change wp_die() to return instead. This should also be changed in the handle() methods.

    public function maybe_handle() {

    // Don't lock up other requests while processing
    session_write_close();

    if ( $this->is_process_running() ) {
    // Background process already running.
    return;
    }

    if ( $this->is_queue_empty() ) {
    // No data to process.
    return;
    }

    $this->handle();
    }

    Thanks!

    Cheers, Jory

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author verygoodplugins

    (@verygoodplugins)

    Hey Jory,

    Thanks for pointing that out!

    maybe_handle() is called by the AJAX endpoint, which does need to die() when it’s finished so it doesn’t hang.

    However, you’re right, handle_cron_healthcheck() should not die, it should just return, and we should remove the wp_die() in the handle function as well. That way it will return during the cron process, and die when it’s running via AJAX.

    We’ve made those changes for the next update of the plugin. Thanks again!

    Jack

    Thread Starter Jory Hogeveen

    (@keraweb)

    Hi Jack,

    Ah check! I didn’t notice that it was AJAX related as well.
    Thank you for the prompt reply and actions!

    Thanks, Jory

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.