Commit b6d55f0
committed
perf(push-notification): optimize push notification dispatch by grouping device tokens
This commit improves the performance of the push notification dispatch process
by grouping device tokens by user ID before sending notifications. This change
avoids iterating through all devices for each user, which reduces the time
complexity from O(N^2) to O(N), significantly speeding up the dispatch process.1 parent 792dbc8 commit b6d55f0
1 file changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
| |||
214 | 229 | | |
215 | 230 | | |
216 | 231 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 232 | + | |
| 233 | + | |
222 | 234 | | |
223 | 235 | | |
224 | 236 | | |
| |||
0 commit comments