Commit 4f260b2
perf: optimize resolve workflow and plugin listing (#857)
## Summary
- **Skip update checks in resolve_workflow**: `resolve_workflow()` only
needs plugin `name` and `version`, not update availability. Added
`skip_update_check` parameter to `list_plugins_sync()` — resolve goes
from N × (up to 60s) subprocess calls to near-instant.
- **TTL cache on `_check_plugin_update()`**: Results are cached for 10
minutes so repeated Nodes panel opens or plugin listings reuse cached
results instead of spawning `uv pip compile` subprocesses.
- **Pre-warm cache at startup**: A background task calls
`list_plugins_sync()` during app startup so the cache is warm by the
time the user first opens Nodes.
- **Cache invalidation**: `_invalidate_plugin_caches()` (called on
install/uninstall) also clears the update check TTL cache.
## Test plan
- [ ] Open the app, click "Nodes" — should load quickly (cache warmed at
startup)
- [ ] Import a workflow via "Resolve Workflow" — should resolve
near-instantly
- [ ] Install/uninstall a plugin, then reopen Nodes — should show fresh
update info
- [ ] Wait 10+ minutes and reopen Nodes — should re-fetch update info
(TTL expired)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Rafał Leszko <rafal@livepeer.org>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 5895e8e commit 4f260b2
3 files changed
Lines changed: 76 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| |||
665 | 677 | | |
666 | 678 | | |
667 | 679 | | |
668 | | - | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
669 | 683 | | |
670 | 684 | | |
671 | 685 | | |
672 | 686 | | |
673 | 687 | | |
674 | 688 | | |
675 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
676 | 692 | | |
677 | | - | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
678 | 696 | | |
679 | 697 | | |
680 | 698 | | |
| |||
722 | 740 | | |
723 | 741 | | |
724 | 742 | | |
725 | | - | |
| 743 | + | |
726 | 744 | | |
727 | 745 | | |
728 | 746 | | |
| |||
779 | 797 | | |
780 | 798 | | |
781 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
782 | 803 | | |
783 | 804 | | |
784 | 805 | | |
| |||
788 | 809 | | |
789 | 810 | | |
790 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
791 | 819 | | |
792 | 820 | | |
793 | 821 | | |
794 | 822 | | |
795 | 823 | | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
796 | 828 | | |
797 | 829 | | |
798 | | - | |
| 830 | + | |
799 | 831 | | |
800 | 832 | | |
801 | 833 | | |
| |||
809 | 841 | | |
810 | 842 | | |
811 | 843 | | |
812 | | - | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
813 | 847 | | |
814 | 848 | | |
815 | 849 | | |
| |||
841 | 875 | | |
842 | 876 | | |
843 | 877 | | |
844 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
845 | 881 | | |
846 | 882 | | |
847 | 883 | | |
848 | 884 | | |
849 | 885 | | |
850 | | - | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
851 | 889 | | |
852 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
853 | 893 | | |
854 | 894 | | |
855 | 895 | | |
856 | | - | |
| 896 | + | |
857 | 897 | | |
858 | 898 | | |
859 | 899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
| |||
328 | 336 | | |
329 | 337 | | |
330 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
331 | 352 | | |
332 | 353 | | |
333 | 354 | | |
| |||
384 | 405 | | |
385 | 406 | | |
386 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
387 | 412 | | |
388 | 413 | | |
389 | 414 | | |
| |||
0 commit comments