mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-14 12:29:33 -06:00
This commit refactors the code in the `chatwoot.service.ts` and `repository.service.ts` files to use streams instead of temporary files. This change reduces the number of disk operations, making the application faster and more efficient. In the `chatwoot.service.ts` file, the `createReadStream`, `unlinkSync`, and `writeFileSync` functions have been replaced with the `Readable` stream. The `sendData` method has been updated to accept a `fileStream` and `fileName` instead of a file path. The `processImage` method has been refactored to use a stream instead of writing the image to a file. In the `repository.service.ts` file, the `initStoreFolders` method has been removed, as it is no longer needed. These changes improve the maintainability of the codebase by reducing the number of disk operations and simplifying the code. This refactoring also makes the application more efficient and faster, as it reduces the number of disk operations. Motivation: The motivation behind this refactoring is to improve the performance and efficiency of the application by reducing the number of disk operations. Impact: This refactoring reduces the number of disk operations, making the application faster and more efficient. It also simplifies the codebase and improves its maintainability. |
||
|---|---|---|
| .. | ||
| repository.service.ts | ||