Ecommerce Shopify WordPress Discussion

action_scheduler not cancelling recurring action while running

I am building a plugin with action_scheduler but unable to cancel a recurring action inside its hook execution while running. I am using this code to cancel a recurring action to not run next until added again but its not cancelling the action and keeps scheduling: as_unschedule_action() But when I call above function as_unschedule_action() to cancel that same recurring action outside its hook/execution, then it works. Please help me on it. Thanks Edit This is how I trying to do: scheduling a recurring event using: as_schedule_recurring_action(time(),'5min','test_action') to run every 5min while this event's action running, I am cancelling this recurring event using as_unschedule_action('test_action') so that it'll stop to run again, but its still scheduling and keeping running.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.