• Resolved lortan29

    (@lortan29)


    Hello. I created a repeating as_schedule_cron_action and at the time of execution it is duplicated many times, but if run through the admin panel, it is not duplicated.

    add_action('init', array($this, 'slabs_sync_cron'));
    
    

    public function slabs_sync_cron() {
    if ( false === as_next_scheduled_action( ‘sync_slabsmith_products_cron’ ) ) {
    as_schedule_cron_action( time(), ‘* */10 * * * *’, ‘sync_slabsmith_products_cron’, [], $group = ‘slabsmith_products’ );
    }
    if ( false === as_next_scheduled_action( ‘sync_slabsmith_products_to_wp’ ) ) {
    as_schedule_cron_action( time(), ‘0 23 * * * *’, ‘sync_slabsmith_products_to_wp’, [], $group = ‘slabsmith_products’ );
    }
    }`
    `
    The worker is launched via WP-CLI. Standard plugin cron is disabled. I found an old post on this topic, but it did not help me https://github.com/woocommerce/action-scheduler/issues/387

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Duplication of repetitive actions’ is closed to new replies.