function execute background
-
Hi Everyone,
I’m create a plugin to get woocommerrce data to external system. but it take lot of time to execute also serve show 502 error after i used cron function to execute that function but it not working properlyadd_action('wpse71941_cron', 'wpse71941_long_running'); function wpse71941_long_running($args) { // might need to call <code>set_time_limit</code> here set_time_limit(0); include 'customers.php'; include 'orders.php'; include 'products.php'; // return normal time limit if($l = ini_get('max_execution_time')) set_time_limit($l); } // schedule the event for right now wp_schedule_single_event( time(), 'wpse71941_cron', array('args' => 'for', 'callback' => 'function') );
this cron execute repeatly i want to execute it a only one time like execute with plugin activate after run my other stuff. how can i do it
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘function execute background’ is closed to new replies.