coyote-team / coyote-wp

Wordpress Plug-in for Coyote
2 stars 2 forks source link

Process existing posts asynchronously #25

Closed jkva closed 4 years ago

jkva commented 4 years ago

Especially in the case of many posts this can take a while. Use WordPress' ajax handlers to run this in a separate request.

jkva commented 4 years ago

Implemented via 7168fe944a5febf89886257d165f21a137a72e5e

sinabahram commented 4 years ago

I’m interested on learning more about this one because this implies the browser needs to be open, which is pretty much a non-starter, I imagine for anything past a few hundred posts, but maybe I’m misunderstanding it or underestimating how fast this can happen.

jkva commented 4 years ago

@sinabahram I've implemented this via the asynchronous WP request logic that you tipped me about yesterday. This happens via WordPress' native ajax handling code and gets kicked off via a non-blocking separate request.

sinabahram commented 4 years ago

Understood. I thought it was persistent via AJAX, not just kicked off by it, so we’re all good e.g. someone can click the button, then close their browser, and we’re fine, assuming of course traffic is coming in because otherwise the crons won’t fire.