Thursday, February 9, 2023
HomeWordPress Developmentphp - Background Duties in a WP Cronjob?

php – Background Duties in a WP Cronjob?


I’ve particular duties which I need to carry out each 15s within the background to replace some cache / transients. I already use an exterior Cronjob service that triggers the Cron runs in WP – however sadly it will possibly solely set off the cronjobs each 1min.

My easy concept to unravel it was

I might merely do a for-loop which does it:

for($i = 0; $i < 5; $i++) {
  update_my_cache();
  sleep(15);
}

Huge caveat: This might clearly block different PHP duties operating within the cronjob.

Therefore my query is:
Is it potential in PHP and WordPress to make use of Threaded Cronjob duties which may run in parallel or be referred to as individually?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments