So many wc-admin_import_orders tasks being scheduled when doing custom migration
-
We ran a custom migration script that would loop through about 17k orders to 1) copy data from a couple postmeta entries into a different postmeta entry and 2) to remove the old postmeta entry. The problem that we have is that a TON of “wc-admin_import_orders” tasks were scheduled in ActionScheduler, so many that it caused our ActionScheduler to be clogged up, which then impacted the Woo Analytics and other things.
I would like to know what these wc-admin_import_orders tasks are for and if they are needed to run in my case. For the time being I have set these tasks in to a different status so they aren’t “pending” just to make sure they don’t clog up the ActionScheduler, but if these tasks are important I would like to understand better.
I’m not going to provide the entire script here but here is the pseudo code so you can see the most important parts:
// Get the target order ids and loop over them (not shown in code here)… then get old format tracking number:
$tracking_number = $order->get_meta( ‘ph_shipment_tracking_ids’ );
// Then call function which would do an insert into postmeta table (not shown in code here)… then delete the old tracking number entry:
$wpdb->delete( $wpdb->postmeta, array( ‘post_id’ => $order_id, ‘meta_key’ => ‘ph_shipment_tracking_ids’));
- The topic ‘So many wc-admin_import_orders tasks being scheduled when doing custom migration’ is closed to new replies.