• Resolved valerio1996

    (@valerio1996)


    Hello,
    I have a problem with an external plugin that imports lots of products with cron jobs.

    During the import I have approximately 6000 cron jobs scheduled with this function: WC_Cache_Helper::delete_version_transients()
    and this afflict the import process, the import become very slow.

    I have WC version: 3.4.5
    and WordPress version: 4.9.8

    Can you help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Ross V. a11n

    (@rossviviano)

    Automattic Happiness Engineer

    Hi there,

    If you’re having trouble with a plugin other than WooCommerce, you’ll want to get in touch with the developers of that plugin for support. They’ll have a better idea than we do ??

    Best,

    Ross

    Thread Starter valerio1996

    (@valerio1996)

    Hello Ross,
    thank you for the reply.

    I have solved the problem commenting the line 162 of the includes>class-wc-cache-helper.php file.

    This is the line:
    line 162 " // wp_schedule_single_event( time() + 30, 'delete_version_transients', array( $version ) ); "

    Now the import is very fast.

    I have to comment each time I upgrade woo commerce?

    Regards,
    Valerio.

    krizkroz

    (@krizkroz)

    Hi Valerio,

    you can prevent scheduling without a hack via

    add_filter ( 'schedule_event', function ( $event ) {
    	
    	if ( $event -> hook == 'delete_version_transients' ) return FALSE;
    
    	return $event;
    
    }, '10', 1 );

    Using this filter only while importing.

    Ross, thats a WooCommerce issue using native functions of them while importing a huge amount of products programmatically. :-/

    • This reply was modified 6 years ago by krizkroz.
    • This reply was modified 6 years ago by krizkroz.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Import process too slow: WC_Cache_Helper::delete_version_transients()’ is closed to new replies.