Description
Hello there 👋👋
I have chosen this issue template since I don't know where else to post my question:
My Question
Are Requests being finished, even if the user that invoked the current script closes their browser?
Additional context
I ended up in this Repo since I source-dived wp-cron to find out how it worked. Turns out it sends a HTTP request from cron.php
to wp-cron.php
to invoke scheduled jobs:
$result = wp_remote_post( $cron_request['url'], $cron_request['args'] );
That call leads through a few other files to this request call in class-wp-http.php
:
$requests_response = WpOrg\Requests\Requests::request( $url, $headers, $data, $type, $options );
Now I couldn't find any resources on the web about the question if this HTTP POST call will be finished, even if the current visitor closes their connection (e.g. browser tab) – or if it will be cancelled with the user session. That would be valuable information for scenarios where there would be long running processes that should be invoked by a cron job.
Source-diving the Requests library also is a bit over my head 😅 I'd be very grateful for any definite answer! It would be amazing to be pointed towards the relevant code, if it turns out that these requests will be finished, not matter what...