Comments (5)
Also, to add, we have one "fl_featured_product_remove" action pending. This action is for another post_id.
from action-scheduler.
Hi @Dekadinious. It's true that the meaning of the $unique
argument isn't properly documented, apologies for that. What $unique
does is the following: "If an action with the same combination of hook name and group is already pending or running, do nothing and return zero". So this is what is likely happening to you.
Yes, you are using as_unschedule_action
before as_schedule_single_action
. But this will remove only the next scheduled action; if there are more actions scheduled with the same hook (maybe you created them while testing?) they won't be removed.
My suggestion is to use as_unschedule_all_actions
instead, this will effectively remove all the actions for the hook and group. Please try that and get back to us wit the results.
from action-scheduler.
I managed to find out by digging through the code. I also submitted a PR 😊
I initially thought the arguments were part of what made it unique. As you can see I am trying to schedule actions that should be unique per post ID. I removed the unique parameter and now it works 👍
One question though: Will the removal of action make sure to only remove actions where the arguments also match?
from action-scheduler.
@Dekadinious Awesome, thanks for your contribution!
As for your question: I guess you are referring to as_unschedule_action
and as_unschedule_all_actions
. These will only remove actions with matching arguments provided that a non-empty list of arguments is provided to the functions.
from action-scheduler.
Thank you! @Konamiman
Closing this now :)
from action-scheduler.
Related Issues (20)
- action_scheduler/migration_hook will not be executed as no callbacks are registered. HOT 2
- Need to add a hook when ever new action is registered HOT 2
- Switch translation inside schedule hook HOT 1
- Document all the hooks and publish to documentation page about them
- Hybrid store does not support unique actions HOT 1
- Make it easier to determine if we are 'inside' a queue processor HOT 5
- PHP Fatal error: Uncaught Error: Class "ActionScheduler_Lock" on plugin uninstall HOT 2
- WordPress.org plugin review warnings/issues HOT 1
- ActionScheduler tables are not reinitialized after manually deleting the tables HOT 3
- Documentation - clarify that tasks will run at the specified time or later HOT 1
- Improve timeout calculations with more accurate start time and by including all tasks HOT 1
- `has_pending_actions_due()` performance improvements HOT 2
- Batch size should be adjustable during processing HOT 1
- Document all WP CLI (sub-)commands
- Have Past Due Items but CLI command won't pick them up HOT 3
- Action scheduler in comments HOT 1
- Could I pause scheduled actions? HOT 2
- Use ErrorException when catching errors while processing scheduled actions HOT 1
- How to avoid failed actions because of unable to update status to "in-progress"? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-scheduler.