Close the worker's DB connection and join the thread.
()
| 175 | |
| 176 | /** Close the worker's DB connection and join the thread. */ |
| 177 | async close(): Promise<void> { |
| 178 | if (this.exited) return; |
| 179 | this.worker.postMessage({ type: 'close' }); |
| 180 | await new Promise<void>((resolve) => { |
| 181 | const t = setTimeout(() => { |
| 182 | void this.worker.terminate().then(() => resolve()); |
| 183 | }, 5000); |
| 184 | this.worker.once('exit', () => { |
| 185 | clearTimeout(t); |
| 186 | resolve(); |
| 187 | }); |
| 188 | }); |
| 189 | } |
| 190 | } |
nothing calls this directly
no test coverage detected