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

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board
๐Ÿ› ๏ธ

Bug & Fixes

Tags

High Priority

Date

8 months ago

Author

Piyush Patel

Subscribe to post

Get notified by email when there are changes.