I am getting error while running a function get_users() in my custom plugin
PHP Fatal error: Uncaught Error: Call to undefined function cache_users() in /Users/priyankgohil/sites/upw-new/wp-includes/class-wp-user-query.php:843
Stack trace: #0 /Users/priyankgohil/sites/upw-new/wp-includes/class-wp-user-query.php(79): WP_User_Query->query() #1 /Users/priyankgohil/sites/upw-new/wp-includes/user.php(763): WP_User_Query->__construct(Array) #2 /Users/priyankgohil/sites/upw-new/wp-content/plugins/my-plugin/Inc/BaseController.php(214): get_users(Array)
is anyone have solution or facing same issue after upgrade to wordpress 6.1

Until this gets fixed, you can add the following above line 843 of wp-includes/class-wp-user-query.php:
This function looks like it was introduced in the new version, and the code (in other areas) appears to check for functions within pluggable.php before requiring the file.