actions – Code run fast on a cronjob but slow with a do_action or ajax call


I am creating several posts from a csv, when I execute the code using a cronjob the operation lasts about 7 minutes, but if I use the code directly in a template, or make a call to do_action or execute the code through ajax it takes more than 30 minutes and sometimes it doesn’t even complete (generates a time limit error).

Does anyone know what could be happening?

For the creation of the posts I am using wp_insert_post, update_post_meta and wp_set_object_terms. Total posts created is 6544, when created WITHOUT the cronjob it tends to only create around 3000 +/- before failing

Kleiver 1 year 2021-08-21T19:04:08-05:00 0 Answers 0 views 0

Leave an answer