Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid excessive libraries index downloads on lib search #1624

Closed
cavonlee opened this issue Jan 14, 2022 · 5 comments · Fixed by #2072
Closed

Avoid excessive libraries index downloads on lib search #1624

cavonlee opened this issue Jan 14, 2022 · 5 comments · Fixed by #2072
Assignees
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@cavonlee
Copy link

cavonlee commented Jan 14, 2022

Bug Report

Current behavior

./arduino-cli lib search

Running lib search will always force to update index.

Expected behavior

Donot force to update index every time.

Environment

  • CLI version (output of arduino-cli version): Version: 0.20.2 Commit: 1378381 Date: 2021-12-07T16:41:50Z
  • OS and platform: macOS Monterey 12.1

Additional context

core search works fine without forcing update index.

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jan 14, 2022
@per1234
Copy link
Contributor

per1234 commented Jan 14, 2022

Related: #1043

@cavonlee
Copy link
Author

@per1234 OK, if update index is meant to do before every search, is fine, just a little slow. but the problem is that, the update index output format jsonmini is not working. and search outputs so many datas, it would be helpful to use jsonmini.

@per1234
Copy link
Contributor

per1234 commented Jan 14, 2022

Hi @cavonlee. Thanks so much for your report. My comment was only intended to add some cross-references to related information.

I see that an index caching system was put in place for core search here: #1237 but that was not done for lib search.

@cavonlee
Copy link
Author

@per1234 OK, thanks too. If so I wanna ask why update index every time search? it slows down the search process. And if so, the update index is becoming usless. I suggest break them up, and let user decide when to update. Or maybe break into two level api, the high level one do both, makes it easier for beginners, if it is what concidering.

@per1234 per1234 changed the title lib search force update-index Avoid excessive libraries index downloads on lib search Jan 24, 2022
@per1234 per1234 added type: enhancement Proposed improvement and removed type: imperfection Perceived defect in any part of project labels Jan 24, 2022
@per1234
Copy link
Contributor

per1234 commented Jan 24, 2022

the update index output format jsonmini is not working

Since the bug of not all output being valid JSON when --format jsonmini is used is completely separate from the one of an index update being done on every lib search command, I have moved it to a dedicated issue here: #1635.

That will make it easier for us to track the two.

Thanks for your report @cavonlee!

ardnew added a commit to ardnew/arduino-cli that referenced this issue Jul 1, 2022
MatteoPologruto pushed a commit to MatteoPologruto/arduino-cli that referenced this issue Feb 13, 2023
MatteoPologruto added a commit that referenced this issue Feb 13, 2023
…is executed (#2072)

* cli: use cached index with lib search (#1624)

* remove comment on default cache timeout (maintenance smell)

* Simplify code applying minor changes

---------

Co-authored-by: ardnew <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
5 participants