()
| 104 | } |
| 105 | |
| 106 | public async destroy() { |
| 107 | if (this.hocuspocusServer) { |
| 108 | this.hocuspocusServer.closeConnections(); |
| 109 | logger.info("SERVER: HocusPocus connections closed gracefully."); |
| 110 | } |
| 111 | |
| 112 | await redisManager.disconnect(); |
| 113 | logger.info("SERVER: Redis connection closed gracefully."); |
| 114 | |
| 115 | if (this.httpServer) { |
| 116 | await new Promise<void>((resolve, reject) => { |
| 117 | this.httpServer!.close((err) => { |
| 118 | if (err) { |
| 119 | reject(err); |
| 120 | } else { |
| 121 | logger.info("SERVER: Express server closed gracefully."); |
| 122 | resolve(); |
| 123 | } |
| 124 | }); |
| 125 | }); |
| 126 | } |
| 127 | } |
| 128 | } |
no test coverage detected