Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Integrating with cron. . . #34

Open
MickeyKay opened this issue Feb 28, 2015 · 1 comment
Open

Integrating with cron. . . #34

MickeyKay opened this issue Feb 28, 2015 · 1 comment

Comments

@MickeyKay
Copy link

This question may be totally out of scope, however I'd love see an example or at least hear your thoughts on how integrate this with a background cron job.

We have a situation in which we need to ping an API for quite a bit of data, and doing so live just takes too long. The background_only() method would work just fine, however the traffic to the site is low enough that it could be quite a while before a new visitor triggers a background fetch, and the API data is updating very rapidly. As such, we'd like to fetch it more frequently, potentially with using a regularly triggered cron job (set to trigger regularly on the server).

So, a few questions:

  1. Is there a way to accomplish this purely with WP-TLC-Transients?
  2. If not, do you by any chance have an example of integrating this with cron?
  3. Are there any special considerations you can think of that we'd need to keep in mind?

Thanks a ton y'all, this is great!

@jmslbam
Copy link

jmslbam commented Feb 29, 2024

Mickey, a bit late to the show, but you can call you method from a wp-cli command and run that every night.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants