Closed Flo4604 closed 1 month ago
I just added this ticket for tracking purposes, as I've already worked on a PR for this.
The most obvious issue for me seems to be this code in the createRootKey code:
It loops over each selected permission, and does a single query which is unnecessary overhead, also ingests audit logs one by one instead of batching them all at the same time.
Thanks for opening the issue @Flo4604 I just assigned it to you just so no one else works on it as I know you have a PR 🙇
Preliminary Checks
[X] I have reviewed the documentation: https://unkey.com/docs
[X] I have searched for existing issues: https://github.com/unkeyed/unkey/issues
[X] This issue is not a question, general help request, or anything other than a bug report directly related to Unkey. Please ask questions in our Discord community: https://unkey.com/discord.
Reproduction / Replay Link (Optional)
No response
Issue Summary
Creating a rootkey can take a very long time, in this case 16seconds. The more permissions the longer it takes
https://github.com/user-attachments/assets/ef91b1ed-2362-430e-8aa4-e58c66508f11
Steps to Reproduce
Create a rootkey with as many permissions selected as possible.
Expected behavior
It takes less time
Other information
No response
Screenshots
No response
Version info