You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a users service covered with softDelete hook, then there will be 2 users.get calls for every request to it and to eny other service, that requires a populated user, e.g. services that are covered with restrictToRoles.
Since users.get most likely is fetching data from the database it is expensive, because database ops usually are the most expensive operations in request handling code.
It have a significant impact on performance in high load projects.
Second call appears when softDelete hook is calling service.get while already processing service.get request, to check whether the resource is deleted or not. But after this check we have a complete result already, this result was processed by all succeeding hooks, so we do not need to call service.get second time.
If you have a users service covered with softDelete hook, then there will be 2 users.get calls for every request to it and to eny other service, that requires a populated user, e.g. services that are covered with restrictToRoles.
Since users.get most likely is fetching data from the database it is expensive, because database ops usually are the most expensive operations in request handling code.
It have a significant impact on performance in high load projects.
Second call appears when softDelete hook is calling service.get while already processing service.get request, to check whether the resource is deleted or not. But after this check we have a complete result already, this result was processed by all succeeding hooks, so we do not need to call service.get second time.
The code points:
The text was updated successfully, but these errors were encountered: