Commit db61eae
authored
Gracefully handle cached files being deleted (#1959)
The global cache in the `apk` package stores cached
`expandapk.APKExpanded` structs in memory, which references files on
disk and contains readers for those files. The in-memory data is
currently never invalidated, which can lead to problems if the files on
disk are deleted. This PR updates the cache to check if the backing file
still exists before returning data from the cache. If it's absent, the
APK data is re-populated.1 parent bb43366 commit db61eae
2 files changed
+40
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
644 | 643 | | |
645 | 644 | | |
646 | 645 | | |
| |||
1262 | 1261 | | |
1263 | 1262 | | |
1264 | 1263 | | |
1265 | | - | |
| 1264 | + | |
1266 | 1265 | | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | 1266 | | |
1271 | 1267 | | |
1272 | 1268 | | |
1273 | 1269 | | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
| 1270 | + | |
| 1271 | + | |
1277 | 1272 | | |
1278 | | - | |
| 1273 | + | |
1279 | 1274 | | |
1280 | 1275 | | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
1287 | 1289 | | |
1288 | 1290 | | |
1289 | | - | |
1290 | 1291 | | |
1291 | 1292 | | |
1292 | 1293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
756 | 779 | | |
757 | 780 | | |
758 | 781 | | |
| |||
0 commit comments