()
| 207 | } |
| 208 | |
| 209 | async close(): Promise<void> { |
| 210 | logger.info("Closing queues + workers", { |
| 211 | event: "queues.shutdown.started", |
| 212 | }); |
| 213 | |
| 214 | const tasks: Promise<void>[] = [ |
| 215 | this.accountMaintenanceWorker.close(), |
| 216 | this.accountMaintenanceQueue.close(), |
| 217 | this.emailDeliveryWorker.close(), |
| 218 | this.emailDeliveryQueue.close(), |
| 219 | this.notificationDispatchWorker.close(), |
| 220 | this.notificationDispatchQueue.close(), |
| 221 | this.notificationMaintenanceWorker.close(), |
| 222 | this.notificationMaintenanceQueue.close(), |
| 223 | ]; |
| 224 | |
| 225 | if (this.webPushDeliveryWorker !== null) { |
| 226 | tasks.push(this.webPushDeliveryWorker.close()); |
| 227 | } |
| 228 | |
| 229 | if (this.webPushDeliveryQueue !== null) { |
| 230 | tasks.push(this.webPushDeliveryQueue.close()); |
| 231 | } |
| 232 | |
| 233 | await Promise.all(tasks); |
| 234 | |
| 235 | logger.info("Queues + workers closed", { |
| 236 | event: "queues.shutdown.completed", |
| 237 | }); |
| 238 | } |
| 239 | } |
no test coverage detected