wp-background-processing-example icon indicating copy to clipboard operation
wp-background-processing-example copied to clipboard

Dispatch seems to have no effect.

Open mhdtahawi opened this issue 7 years ago • 5 comments

Hi, Thank you for the efforts. I am sure it is not working because I am not using it correctly. I am hoping you can help me with that :)

Here is what I am doing:

class WP_Example_Request extends WP_Async_Request {

    /**
     * @var string
     */
    protected $action = 'create_send_pdf';

    /**
     * Handle
     *
     * Override this method to perform any actions required
     * during the async request.
     */
    protected function handle() {
   
	   file_put_contents("logs.txt", "writing file" );


    }

and in my code:

echo ("callign backgroudnd thread <br />");
$example_request = new WP_Example_Request();
$example_request->data( array( 'orderID' => $_GET["orderID"] ) )->dispatch();
echo (" backgroudnd thread called");

It seems like the file is not being written any where. I am trying to find a way to log what I am doing, to be able debug later.

Anything I am doing wrong?

mhdtahawi avatar Aug 01 '17 21:08 mhdtahawi

@mhdtahawi I have the same issue, did you figure this out?

elvismdev avatar Oct 30 '18 23:10 elvismdev

It's my first time looking at this library and I am having the same issue.

I am using background processing and I am seeing the wp_{action} added to the wp_options table but I am not seeing any new WP Cron events added to the queue.

w33zy avatar Nov 12 '18 16:11 w33zy

Did anyone ever get a fix for this? My dispatch is not adding new cron jobs either.

DeveloperWil avatar May 17 '19 04:05 DeveloperWil

same issue

ram33z avatar Sep 15 '19 10:09 ram33z

Looks like it's borked. I'm going to go with Delicious Brains background processor - looks like it's written by the same guy but hopefully it works https://github.com/deliciousbrains/wp-background-processing

DeveloperWil avatar Sep 16 '19 00:09 DeveloperWil