Commit c0eb64f
committed
fix: handle MySQL mirror connection failure gracefully in v1 prepareDb
V1's prepareDb() crashed with ECONNREFUSED when the MySQL mirror sidecar
wasn't ready, causing the entire CADT process to exit. V2's prepareV2Db()
already handled this gracefully with a try-catch. This aligns V1 with
V2's behavior: log the error and continue with the main SQLite database.
The mirror will reconnect on the next sync cycle via safeMirrorDbHandler.
Also adds the missing connection.end() call in a finally block to
prevent connection leaks on any failure path.1 parent 5be9063 commit c0eb64f
1 file changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
174 | 175 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
178 | 183 | | |
179 | | - | |
| 184 | + | |
180 | 185 | | |
181 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
182 | 191 | | |
183 | 192 | | |
184 | 193 | | |
| |||
0 commit comments