Optimize File Retrieval in Aggregated Methods by Deferring Storage Service Call
Both getAggregated and getManyAggregated Methods called the storage service individually to bind files during aggregation. This led to multiple redundant calls to getFilesMap, impacting performance and scalability.
This change refactors the logic to defer the file-binding process until after all aggregation operations are complete. By collecting all fileIds and making a single call to the storage service:
We reduce redundant external calls
Improve response time and efficiency
Simplify code responsibility by separating data aggregation from file retrieval
Now, const signedUrls = await this.gatewayService.getFilesMap(fileIds, true); is only called once, post-aggregation, improving the overall performance of file handling operations.
- Domain
- General
- Action
- fix
- Department
- Backend
Status: Completed
Log in to comment and vote
No comments yet
Be the first to share your thoughts.