Commit edac98b
committed
fix: add download timeouts and retry on transient failures
Fixes #242. Three downloader weaknesses combined to make setup fragile when a remote (e.g. vault.omniarchive.uk) is slow or flaky:
- openURLStream did not set connect or read timeouts, so a stalled remote could hang the GUI indefinitely (user reported being stuck at 5%)
- downloadFile only attempted once, so any single SSL reset or timeout aborted the whole setup
- A failed mid-stream download left a partial file on disk that could confuse subsequent runs
Set 30s connect / 60s read timeouts, retry up to 3 times with linear backoff on IOException, and clean up the partial file before each retry. Also closes the URL stream via try-with-resources, fixing a small resource leak in the original.1 parent c094346 commit edac98b
1 file changed
Lines changed: 32 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
147 | 170 | | |
| 171 | + | |
148 | 172 | | |
149 | 173 | | |
150 | 174 | | |
151 | 175 | | |
152 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
153 | 181 | | |
154 | 182 | | |
155 | 183 | | |
| |||
0 commit comments