Commit fc4a05b
authored
fix: implement index auto-refresh (searchTtlSeconds) (#31)
Three improvements to the package index update mechanism:
1. Implement searchTtlSeconds auto-refresh: new ensure_index_fresh()
checks if local index data exists and is within the configured TTL
(default 3600s). Runs `xlings update` automatically when stale.
2. mcpp build auto-triggers index update: before dependency resolution,
checks if the project has version-source deps and the index is
missing/stale. Prevents silent failure on fresh installs.
3. Fix misleading "Updating registry index" in mcpp search: replaced
with actual auto-refresh via ensure_index_fresh() — only prints
when an update actually happens.
Also refactored cmd_index_update to use xlings::update_index instead
of manual popen.1 parent f9b22e0 commit fc4a05b
2 files changed
Lines changed: 79 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1194 | 1210 | | |
1195 | 1211 | | |
1196 | 1212 | | |
| |||
2311 | 2327 | | |
2312 | 2328 | | |
2313 | 2329 | | |
2314 | | - | |
| 2330 | + | |
| 2331 | + | |
2315 | 2332 | | |
2316 | 2333 | | |
2317 | 2334 | | |
| |||
2390 | 2407 | | |
2391 | 2408 | | |
2392 | 2409 | | |
2393 | | - | |
2394 | | - | |
2395 | | - | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
| 2410 | + | |
2401 | 2411 | | |
2402 | 2412 | | |
2403 | 2413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
205 | 220 | | |
206 | 221 | | |
207 | 222 | | |
| |||
745 | 760 | | |
746 | 761 | | |
747 | 762 | | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
748 | 808 | | |
0 commit comments