Store the user statistics for the performance.

This commit is contained in:
Sébastien André
2021-08-11 22:37:14 +02:00
parent 6c53408c6d
commit 4c1dc89006
64 changed files with 453 additions and 1783 deletions

View File

@@ -30,7 +30,7 @@ namespace skydiveLogs_api.DomainBusiness
_gearRepository.Add(newGear);
var userId = _identityService.ConnectedUser.Id;
_cacheService.Delete(CacheType.Gear, id: userId);
_cacheService.Delete(CacheType.Gear, userId: userId);
}
public void AddRentalGear(User newUser)
@@ -58,13 +58,13 @@ namespace skydiveLogs_api.DomainBusiness
public IEnumerable<Gear> GetAllGears()
{
var userId = _identityService.ConnectedUser.Id;
if (!_cacheService.Contains(CacheType.Gear, id: userId))
if (!_cacheService.Contains(CacheType.Gear, userId: userId))
_cacheService.Put(CacheType.Gear,
_gearRepository.GetAll(_identityService.ConnectedUser),
5 * 60 * 1000,
id: userId);
userId: userId);
return _cacheService.Get<IEnumerable<Gear>>(CacheType.Gear, id: userId);
return _cacheService.Get<IEnumerable<Gear>>(CacheType.Gear, userId: userId);
}
public Gear GetGearById(int id)