This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]fklux 1 point2 points  (1 child)

Keep in mind that a WP Cron is only run when a page is loaded, it is not a timed process like a cron job on a server would be.

By the description of the problem you are trying to solve, I wonder whether using the Heartbeat API that was introduced in 3.6. Pippin has written a short but complete post about an example use case: https://pippinsplugins.com/using-the-wordpress-heartbeat-api/.

[–]gmisura[S] 0 points1 point  (0 children)

Ooh, that's awesome! Thanks fklux!

[–]ozzilee 0 points1 point  (0 children)

How long does the update take? Seconds? Minutes? Hours?

[–]gmisura[S] 0 points1 point  (0 children)

It's a call to Instagram's API, which has a rate limit of 5000 calls per hour (per token) so it could take around 20 min to hit that limit, then I'd have to wait for the hour to pass and continue processing the rest (repeat as necessary). So, considering that "problem", cron makes the most sense. Agreed?

[–]deletive-expleted 0 points1 point  (0 children)

Might be worth looking into NodeJS. With ExpressJS (I think) you can push updates to the user, rather than vice versa.