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

Skip Account Processing Based on User Role in CLI Command #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajvillegas
Copy link

This change introduces a CLI command flag for limiting the account processing to the listed user roles.

This is not an ideal solution, but one I had to implement as a quick fix for a project with millions of user accounts. Currently the get_users() call is ignoring the role__in or role__not_in parameters of the WP_User_Query when added, so this change looks up the user role and skips the processing if it doesn't match with the one provided when running the command.

@kadamwhite
Copy link
Contributor

Should/could we be doing any periodic in-memory cleanup? e.g. this is VIP's guidance on managing in-memory cache resources in long-running commands, a process which used to use the (inappropriate) name stop_the_insanity(). (Glad they changed that function name!)

@rmccue
Copy link
Member

rmccue commented Nov 14, 2024

There's a newer public API to do this, fyi: https://developer.wordpress.org/reference/functions/wp_cache_flush_runtime/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants