_userManager.AddTokenValidityKeyAsync performance issue
See original GitHub issueRelated: https://github.com/aspnetzero/aspnet-zero-core/issues/2926
No filters applied in AbpUserTokens query causing code to load all records. 9520 records in my local db and can’t imagine the load on production.
Possible fixes:
- Delete old tokens
- Apply filters to query
The problem causing code: TokenAuthController > CreateJwtClaims
await _userManager.AddTokenValidityKeyAsync(
user,
tokenValidityKey,
DateTime.UtcNow.Add(expiration.Value)
);
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Poor performance during role deletion #9167 | Support Center
It seems like the call to UserManager.RemoveFromRoleAsync decreases in performance when there are more than a small number of users assigned ...
Read more >Performance issue while loading website #8553
I am using ASP.NET Core, Angular and the version is 7.2.0 and trying to troubleshoot perfroamce issue while laoding application homepage. As ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@maliming yes, we can do that optimization 👍 .
We have introduced AddTokenValidityKeyAsync to AbpUserManager which uses UserIdentifier, see https://github.com/aspnetboilerplate/aspnetboilerplate/commit/28df0afa07786d61d7ed774a074f40c6645acf99.
This method can be used during token generation to store User’s new token instead of the old one.
Now, AbpUserManager requires
IRepository<UserToken, long>
into its constructor.