Giter Site home page Giter Site logo

Comments (5)

Dekadinious avatar Dekadinious commented on June 1, 2024

Also, to add, we have one "fl_featured_product_remove" action pending. This action is for another post_id.

from action-scheduler.

Konamiman avatar Konamiman commented on June 1, 2024

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.

Dekadinious avatar Dekadinious commented on June 1, 2024

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.

Konamiman avatar Konamiman commented on June 1, 2024

@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.

Dekadinious avatar Dekadinious commented on June 1, 2024

Thank you! @Konamiman

Closing this now :)

from action-scheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.