Commit eaaa2ae
committed
refactor(scan): use Promise.allSettled to prevent memory leaks
Switch from Promise.all to Promise.allSettled in fetch-report-data to
prevent memory leaks from short-circuit behavior. If one promise fails
unexpectedly (e.g., bug in catch handler), Promise.all would immediately
reject while the other promise continues running in background, holding
resources and memory.
Promise.allSettled ensures both API calls complete before proceeding,
properly cleaning up all resources regardless of success/failure.1 parent db85ef2 commit eaaa2ae
1 file changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 131 | + | |
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
| |||
157 | 154 | | |
158 | 155 | | |
159 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
160 | 173 | | |
161 | 174 | | |
162 | 175 | | |
| |||
0 commit comments