My problem is not the execution time set in the configuration. I just want to know the best practice to run a function that can possibly insert many many posts in the database.
I am now using wp_schedule_single_event without changing the execution time and passing the data to my custom action and so now avoiding being interrupted by the user leaving the page during the execution.
I can divide the data into smaller groups and run wp_schedule_single_event after wp_schedule_single_event until everything is done.
For example, if I want to insert 1000 rows into posts, Is is good to insert them 5 by 5 by scheduling many event in queue ?
-
This reply was modified 5 years, 1 month ago by adbelkader.
-
This reply was modified 5 years, 1 month ago by adbelkader.
-
This reply was modified 5 years, 1 month ago by adbelkader.