Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Claim actions by oldest ID #139

Merged
merged 2 commits into from
May 17, 2018
Merged

Claim actions by oldest ID #139

merged 2 commits into from
May 17, 2018

Conversation

thenbrent
Copy link
Contributor

@thenbrent thenbrent commented May 11, 2018

Order actions by ID when staking a claim so that if multiple actions are scheduled for the same exact time (to the second), they will be run in the order in which they were created/scheduled.

However, be sure to apply the order only after ordering actions being claimed by number of previous attempts (menu_order) and scheduled date (post_date_gmt), to preserve backward compatibility.

Instigated by this Slack conversation.

So that if multiple actions are scheduled for the same time, they
will be run in the order in which they were created/scheduled.
@thenbrent thenbrent added the type: enhancement The issue is a request for an enhancement. label May 11, 2018
Copy link
Contributor

@JPry JPry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. What would you think about adding unit tests to this?

@JPry JPry added the has feedback Issues for which we requested feedback from the author and received it. label May 11, 2018
@thenbrent
Copy link
Contributor Author

thenbrent commented May 17, 2018

@JPry thanks for adding a unit test! I had it on my todo list to add but didn't get to it. The test looks good to me, so I'll merge now. 👍

@thenbrent thenbrent merged commit c21e35e into master May 17, 2018
@thenbrent thenbrent deleted the claim_by_id branch May 17, 2018 02:12
thenbrent pushed a commit to woocommerce/action-scheduler-custom-tables that referenced this pull request Jun 28, 2018
So that if multiple actions are scheduled for the same time, they
will be run in the order in which they were created/scheduled.

Fixes #21. Counterpart to woocommerce/action-scheduler#139
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has feedback Issues for which we requested feedback from the author and received it. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants